• 36.Samba 文件共享服务1--安装及配置参数解释


    1.Samba 服务程序现在已经成为在Linux 系统与Windows系统之间共享文件的最佳选择。

      1)安装:  

    [root@localhost ~]#yum install samba
    Loaded plugins: langpacks, product-id, subscription-manager
    ………………省略部分输出信息………………
    Installing:
    samba x86_64 4.1.1-31.el7 rhel 527 k
    Transaction Summary
    ===============================================================================
    Install 1 Package
    Total download size: 527 k
    Installed size: 1.5 M
    Is this ok [y/d/N]: y
    Downloading packages:
    Running transaction check
    Running transaction test
    Transaction test succeeded
    Running transaction
    Installing : samba-4.1.1-31.el7.x86_64 1/1
    Verifying : samba-4.1.1-31.el7.x86_64 1/1
    Installed:
    samba.x86_64 0:4.1.1-31.el7
    Complete!

      Samba 服务程序的主配置文件:/etc/samba/smb.conf

      由于在 Samba 服务程序的主配置文件中,注释信息行实在太多,不便于分析里面的重要参数,因此先把主配置文件改个名字,然后使用cat 命令读入主配置文件,再在grep命令后面添加-v 参数(反向选择),

      分别去掉所有以井号(#)和分号(;)开头的注释信息行,对于剩余的空白行可以使用^$参数来表示并进行反选过滤,最后把过滤后的可用参数信息通过重定向符覆盖写入到原始文件名称中。

        

    [root@localhost ~]# mv /etc/samba/smb.conf /etc/samba/smb.conf.bak
    [root@localhost ~]# cat /etc/samba/smb.conf.bak | grep -v "#" | grep -v ";" | grep -v "^$" > /etc/samba/s
    [root@localhost ~]# cat /etc/samba/smb.com
    cat: /etc/samba/smb.com: No such file or directory
    [root@localhost ~]# cat /etc/samba/smb.conf
    [global]
        workgroup = SAMBA
        security = user
        passdb backend = tdbsam
        printing = cups
        printcap name = cups
        load printers = yes
        cups options = raw
    [homes]
        comment = Home Directories
        valid users = %S, %D%w%S
        browseable = No
        read only = No
        inherit acls = Yes
    [printers]
        comment = All Printers
        path = /var/tmp
        printable = Yes
        create mask = 0600
        browseable = No
    [print$]
        comment = Printer Drivers
        path = /var/lib/samba/drivers
        write list = @printadmin root
        force group = @printadmin
        create mask = 0664
        directory mask = 0775

      

  • 相关阅读:
    MDX查询语句
    MyEclipse 点击 部署 按钮 无效
    C#创建数字证书并导出为pfx,并使用pfx进行非对称加解密
    SSIS – 变量和表达式
    使用 SSIS Foreach Loop 容器 – Foreach Item Enumerator
    SSIS – For Loop Container
    SSIS 中的文件系统任务 (File System Task)
    TypeError: parse() got an unexpected keyword argument 'transport_encoding' 安装tensor后报错
    np基本函数大全
    使用OpenCV对图像进行缩放
  • 原文地址:https://www.cnblogs.com/xinghen1216/p/13732282.html
Copyright © 2020-2023  润新知