samba共享修改匿名用户为非nobody
1)linux的samba用户,如果开启匿名用户登陆共享权限,security 设置为 share ,配置如下:
[root@centos69:~]$grep "^[^#^;]" /etc/samba/smb.conf
[global]
workgroup = workgroup
server string = centos69
# logs split per machine
# max 50KB per log file, then rotate
security = share
#passdb backend = tdbsam
guest account = asterisk
# the login script name depends on the machine name
# the login script name depends on the unix user used
# disables profiles support by specifing an empty path
#load printers = no
#cups options = raw
#obtain list of printers automatically on SystemV
[wjj]
comment = wjj
path = /web/wjj.cc
browseable = yes
writable = yes
guest ok = yes
[lch]
comment = lch
path = /web/lch.cc
browseable = yes
writable = yes
guest ok = yes
[zy]
comment = zy
path = /web/zy.cc
browseable = yes
writable = yes
guest ok = yes
[root@centos69:~]$
如果上面的配置没有 “guest account = asterisk”这行,那么默认用户就是 nobody,就是说windows客户端上载文件到linux samba共享文件夹后,文件夹的属主权限就都是 nobody用户。有时候需要用户为asterisk,那么就需要增加这行就行了。
2) 当有客户端连接的时候,你也可以看到连接的时候,samba派生出了一个asterisk用户的进程
[root@centos69:~]ps -ef|grep smb
root 2917 1 0 11:45 ? 00:00:00 smbd -D
root 2922 2917 0 11:45 ? 00:00:00 smbd -D
asterisk 2930 2917 0 11:45 ? 00:00:02 smbd -D
root 3003 1221 0 11:55 pts/0 00:00:00 grep smb
[root@centos69:~]$
那么此进程上载的文件,属组肯定就是asterisk ,而不是默认的nobody了。