CentOS6中直接设置全局配置段linux
security = shareios
或者是在全局配置段添加centos
map to guest = bad user ide
CentOS7中因为security = share已经被废弃须要全局配置段中添加spa
map to guest = bad user server
配置文件详细配置段:dns
#======================= Global Settings =====================================string
workgroup = WORKGROUP it
server string = Samba Server %v io
netbios name = centos
security = user
map to guest = bad user
dns proxy = no
#============================ Share Definitions ==============================
[Anonymous]
path = /tmp/nobody
browsable =yes
writable = yes
guest ok = yes
read only = no
配置完成后设置匿名共享目录:
mkdir -pv /tmp/nobody
[root@localhost samba]# chmod -R 755 /tmp/nobody
[root@localhost samba]# chown -R nobody:nobody /tmp/nobody
#若是使用了selinux须要设置目录的selinux标签
[root@localhost samba]# chcon -t samba_share_t anonymous/
启动samba:systemctl reload smb.service