- [[email protected] samba]# cat smb.conf
- # 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 #在 centos7 之后都要加这一行了
- hosts allow=192.168.10.21 192.168.10.22 #只允许某些 ip 访问这台 samba 服务器; 多个 ip 之间用空格隔开即可; 如果允许某一个网段的话, 可以这样: 192.168.10.0/24
- [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
- [myshare] #这是 samba 共享文件的一个名词; 自己可以随便起个 123 都行, 但最好起得有点代表性
- comment = yang share #这个 comment 后面的文字是对这个 samba 的解释
- path = /data #path 是要分享的路径, 记住, 这路径一定要给到合适权限, 不然访问会出错的.
- writable = yes #决定访问的用户能否写入文件
- guest ok = yes #决定访客用户能否访问
- browseable = yes #出于安全考虑, 有时会让客户端无法看到某个共享目录, 这样只有管理员或者一些重要人士知道 Samba 服务器上有这样一个目录, 而其它人员并不知道这个目录.
- [[email protected] samba]#
来源: http://www.bubuko.com/infodetail-3076402.html