只是想问一下是否可以隐藏用户无权访问的 Samba 共享(通过 AutoFS)?我有 5 个共享,分别用于 5 个不同的用户组(例如:group1...4 和 Public)。当 group1 的成员登录到客户端 PC 时 - 他必须只能看到 Group1 和 Public Samba 共享,其他组也是如此。
已尝试在 smb.conf 文件中添加以下内容:“hide unreadable = yes”-在每个共享中和/或“access based share enum=yes”-在全局部分->按我需要的方式完美运行,但只能通过终端中的命令:smbclient -L“IP-Server”-U“username”。
当我通过 AutoFS 使用 Samba-share 时,用户登录后,用户可以看到所有共享,但我需要隐藏用户无权访问的共享。
谢谢
我的配置:
自动主控
/home auto.home --timeout=60 --ghost /samba auto.samba --timeout=60 --ghost
汽车之家
* -rw,sync,rsize=16384,wsize=16384,hard,intr,file_mode=0600,dir_mode=0700 "ServerIP":/Share/private/&
自动桑巴
Public -fstype=cifs,rw,credentials=/root/.smb/.${USER},uid=${USER},gid=grppublic,file_mode=0660,dir_mode=0770 ://"ServerIP"/Share/public
Group1 -fstype=cifs,rw,credentials=/root/.smb/.${USER},uid=${USER},gid=grpgroup1,file_mode=0660,dir_mode=0770 ://"ServerIP"/Share/Group1
Group2 -fstype=cifs,rw,credentials=/root/.smb/.${USER},uid=${USER},gid=grpgroup2,file_mode=0660,dir_mode=0770 ://"ServerIP"/Share/Group2
Group3 -fstype=cifs,rw,credentials=/root/.smb/.${USER},uid=${USER},gid=grpgroup3,file_mode=0660,dir_mode=0770 ://"ServerIP"/Share/Group3
Group4 -fstype=cifs,rw,credentials=/root/.smb/.${USER},uid=${USER},gid=grpgroup4,file_mode=0660,dir_mode=0770 ://"ServerIP"/Share/Group4
smb配置文件
[global]
workgroup = WORKGROUP
security = user
netbios name = project
passdb backend = tdbsam
printing = cups
printcap name = cups
load printers = yes
cups options = raw
passwd program = /bin/yppasswd %u
domain logons = no
hosts allow = 192.168.1.
access based share enum = yes
[public]
path = /Share/public
valid users = @grpall
write list = @grpall
force group = grpall
browseable = yes
writeable = yes
guest ok = no
read only = no
create mask = 0660
directory mask = 0770
hide unreadable = no
[group1]
path = /Share/Group1
valid users = @grpgroup1
force group = grpgroup1
browseable = no
writeable = yes
guest ok = no
read only = no
create mask = 0660
directory mask = 0770
hide unreadable = yes
[group2]
path = /Share/Group2
valid users = @grpgroup2
force group = grpgroup2
browseable = no
writeable = yes
guest ok = no
read only = no
create mask = 0660
directory mask = 0770
hide unreadable = yes
...and so on for all groups with their paths and permissions