browseable=no
我尝试了/etc/samba/smb.conf 文件中的选项。但挂载后,其他用户仍然可以通过挂载点看到该共享。但据我所知,设置指令browseable=yes
将使其公开可见,而将其设置为 no 则不会使其公开可见。但是,为什么即使我将该指令设置为“否”,其他用户仍然可以通过安装点看到它?我在这里遗漏了一些概念吗?请澄清。非常感谢。
答案1
答案2
[global]
# map to guest = Bad User
# 'Bad User' is not a valid linux account,
# this option will NOT have windows prompt user
# if windows account name does not match a valid
# linux account. Windows will respond with cannot
# access... their might be a problem with your network
# contact your administrator.
# will make it look like samba share is not there
# can be used as extra layer of security to force
# someone to know valid usernames on linux samba server
# map to guest = nobody
# nobody is a valid but locked linux account,
# When the given Windows user account name does not
# match any valid linux account then a prompt will
# pop up in Windows to give user chance to enter
# a valid linux username/password.
# useful if logged in as Administrator in Windows
# and need to access samba shares
# Warning: anyone on network can go \\yourlinuxserver
# and will get the popup and get a chance
# to enter your samba shares.
[homes]
comment = Home Directories
valid users = %S, %D%w%S
browseable = No
inherit acls = Yes
[scratch]
create mask = 660
directory mask = 770
inherit acls = Yes
path = /scratch
read only = No
browseable = Yes
[dataX]
create mask = 660
directory mask = 770
inherit acls = Yes
path = /data_private
read only = No
browseable = No
一旦您选择了一个选项作为map to guest
第一级身份验证,那么browseable
如果您想要隐藏共享以便用户必须知道它的名称,那么“是/否”就会变得有用。例如,如果我的 linux 服务器在网络上的名称是,linuxserver123
那么如果有人去
\\linuxserver123
map to guest
在 Microsoft Windows 中,如果用户名/密码匹配, 他们将收到提示或被拒绝,然后允许他们进入。
此时,给定用户将看到只有他们的主帐户文件夹而不是homes
文件夹,browseable = no
因为[homes]
.
所有经过身份验证的用户都可以看到,但由于设置原因scratch
,他们不会看到该文件夹。dataX
browseable
对于用户要访问dataX
或访问的文件夹,/data_private
他们必须执行以下操作\\linuxserver123\dataX
。如果您仅\\linuxserver123
在 Windows 中执行此操作,并且想要查看除一个主帐户文件dataX
夹之外的文件夹,则设置为.scratch
browseable=yes
[dataX]
一旦通过 Linux 中的 Samba 进行身份验证,如某些给定的本地Linux帐户对于inherit acls = yes
给定的份额,那么本地Linux帐户必须具有读/写/执行权限才能访问给定的共享文件夹和文件。