由于某种原因,我看不到映射到每个用户主目录 [homes] 的主目录共享。我可以直接在 Windows 中将网络驱动器映射到它,也可以在 Mac 上安装它,但尝试浏览所有可用共享时它不会显示。我尝试将 [homes] 共享设置为,browseable = no
但browseable = yes
没有成功。这是我的 smb.conf:
[global]
# Custom edits via hook
#######################
# enable symlinks outside of shares
unix extensions = no
wide links = yes
browseable = Yes
# End custom edits
###################
netbios name = enterprise
workgroup = LIFE
server string = Zentyal File Server
wins support = yes
dns proxy = yes
name resolve order = wins bcast host
interfaces = lo,eth0
bind interfaces only = yes
server role = dc
server role check:inhibit = yes
realm = LIFE.LAN
log level = 3
log file = /var/log/samba/samba.log
passdb backend = samba4
idmap_ldb:use rfc2307 = yes
server services = -dns -nbt -wrepl
server signing = auto
[netlogon]
path = /var/lib/samba/sysvol/life.lan/scripts
browseable = no
read only = yes
[sysvol]
path = /var/lib/samba/sysvol
read only = no
[homes]
comment = Home Directories
path = /home/%S
read only = no
browseable = no
create mask = 0611
directory mask = 0711
vfs objects = acl_xattr full_audit
full_audit:success = connect opendir disconnect unlink mkdir rmdir open rename
full_audit:failure = connect opendir disconnect unlink mkdir rmdir open rename
# Shares
[directories]
comment = Home directories
path = /home
browseable = Yes
read only = No
force create mode = 0660
force directory mode = 0660
vfs objects = acl_xattr full_audit
full_audit:success = connect opendir disconnect unlink mkdir rmdir open rename
full_audit:failure = connect opendir disconnect unlink mkdir rmdir open rename
# Shares
[default]
comment = A share for anything
path = /home/samba//shares/default
browseable = Yes
read only = No
force create mode = 0660
force directory mode = 0660
vfs objects = acl_xattr full_audit
full_audit:success = connect opendir disconnect unlink mkdir rmdir open rename
full_audit:failure = connect opendir disconnect unlink mkdir rmdir open rename
# Shares
[scan]
comment = Printer scans
path = /home/samba//shares/default/Scanned
browseable = Yes
read only = No
force create mode = 0660
force directory mode = 0660
vfs objects = acl_xattr full_audit
full_audit:success = connect opendir disconnect unlink mkdir rmdir open rename
full_audit:failure = connect opendir disconnect unlink mkdir rmdir open rename
[print$]
comment = "Printer Drivers"
path = /var/lib/samba/printers
browseable = yes
read only = yes
guest ok = no
write list = @"Domain Admins"
valid users = @"Domain Users"
#[zentyal-internal-backups]
# path = /tmp
# browseable = yes
# read only = yes
# valid users = @"Domain Admins"
# admin users = @"Domain Admins"
# force group = ebox
# force user = ebox
[zentyal-quarantine]
comment = "Quarantine"
path = /home/samba/quarantine
browseable = Yes
read only = No
# Custom Share
# Generated by hook
[intranet]
comment = intranet
path = /var/www/ministries
browseable = Yes
read only = No
force create mode = 0660
force directory mode = 0660
vfs objects = acl_xattr full_audit
full_audit:success = connect opendir disconnect unlink mkdir rmdir open rename
full_audit:failure = connect opendir disconnect unlink mkdir rmdir open rename
[ministries]
comment = ministries
path = /var/local/ministries
browseable = Yes
read only = No
force create mode = 0660
force directory mode = 0660
vfs objects = acl_xattr full_audit
full_audit:success = connect opendir disconnect unlink mkdir rmdir open rename
full_audit:failure = connect opendir disconnect unlink mkdir rmdir open rename
答案1
如果您尝试从 samba 服务器浏览它们,那么问题就在于lo interface
绑定。
使用interfaces = lo,eth0
只会绑定127.0.0.1
和eth0 IP
。由于某种原因,环回访问是通过进行的27.0.1.1
。
添加127.0.1.1/8
接口或删除bind interfaces only = yes
interfaces = 127.0.1.1/8 lo,eth0
bind interfaces only = yes
答案2
尝试使用[home]
而不是[homes]
作为部分名称和仅有的这些选项:
comment = Home Directories
path = /home/%S
read only = no
答案3
我不了解 samba4,但对于 samba3,这在手册页的特殊部分中有解释。
The [homes] section
If a section called [homes] is included in the configuration file, services connecting clients to their home directories can be
created on the fly by the server.
...
The browseable flag for auto home directories will be inherited from the global browseable flag, not the [homes] browseable flag.
This is useful as it means setting browseable = no in the [homes] section will hide the [homes] share but make any auto home
directories visible.
也许您可以在全局部分中将可浏览标志设置为是。