Centos7 samba配置


Samba配置了很多次,總是忘,現在寫在博客里。

免密碼只讀

最主要的是免密配置,主要用到了兩個配置,要寫在[global]里:

        map to guest = Bad User
        guest ok = yes

結果安裝完了之后,文件夾被識別成了打印機,那是因為錯配了一個參數。
就是在配置public的時候復制時多了一個printable = Yes

    printable = Yes

所有配置:

# See smb.conf.example for a more detailed config file or
# read the smb.conf manpage.
# Run 'testparm' to verify the config is correct after
# you modified it.

[global]
        workgroup = SAMBA
        security = user

        passdb backend = tdbsam

        printing = cups
        printcap name = cups
        load printers = yes
        cups options = raw
        map to guest = Bad User
        guest ok = yes

[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

[public]
        comment = public
        path = /path/to/yourdir
        create mask = 0664
        directory mask = 0775
        public = yes
        writable = yes
        read only = no

加密碼可讀寫

創建用戶:

useradd share -M -p 1234567
pdbedit -a -u share

配置:

[root@localhost cc]# vim /etc/samba/smb.conf
……
[asset]
        comment = public
        path = /home/asset
        create mask = 0777
        directory mask = 0777
        public = no
        writable = yes
        create mode = 0777
        valid users = share
        write list = share
        writable = yes
        force create mode = 0777
        directory mode = 0777
        force directory mode = 0777
        share modes = yes
……


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM