我想设置一个 samba 共享,只允许单个用户“peter”连接。但是,即使我设置了guest ok = no
,运行时testparm -s
它仍然显示Yes
。这是否意味着已启用访客访问?我如何才能成功禁用它?
我已经将 Samba 配置如下:
smb.conf:
[global]
workgroup = SIMERNES
security = user
passdb backend = tdbsam
log level = 5
printing = cups
printcap name = cups
load printers = yes
cups options = raw
encrypt passwords = true
smb encrypt = required
server min protocol = SMB3
[shared]
comment = Shared Folder
path = /var/samba/myfolder
valid users = peter
guest ok = no
public = yes
writable = yes
write list = samba
create mask = 0777
directory mask = 0777
printable = no
testparm -s:
WARNING: The "encrypt passwords" option is deprecated
Loaded services file OK.
Server role: ROLE_STANDALONE
# Global parameters
[global]
printcap name = cups
security = USER
server min protocol = SMB3
workgroup = SIMERNES
idmap config * : backend = tdb
cups options = raw
smb encrypt = required
[shared]
comment = Shared Folder
create mask = 0777
directory mask = 0777
guest ok = Yes
path = /var/samba/myfolder
read only = No
valid users = peter
write list = samba
答案1
您有public = yes
。这是 的同义词guest ok
,因此它实际上会覆盖相同的设置。