我跟着本教程在 Virtualbox 中的 CentOS 7 上启用 Samba 服务,但是它会生成两个相同的共享文件夹,唯一的区别是名称不同。
这是我的 samba.conf
[global]
workgroup = WORKGROUP
server string = Samba Server %v
netbios name = dev
security = user
map to guest = bad user
dns proxy = no
unix charset = UTF-8
dos charset = CP932
passdb backend = tdbsam
printing = cups
printcap name = cups
load printers = yes
cups options = raw
[homes]
comment = Home Directories
valid users = %S, %D%w%S
browseable = No
read only = No
inherit acls = Yes
[printers]
comment = All Printers
path = /var/tmp
printable = Yes
create mask = 0600
browseable = No
[print$]
comment = Printer Drivers
path = /var/lib/samba/drivers
write list = root
create mask = 0664
directory mask = 0775
[secured]
path = /var/www/html
valid users = @apache
guest ok = no
writable = yes
browsable = yes
假设有一个共享文件夹“ secured
”,我不明白为什么“ apache
”,它们都链接到同一地址“/var/www/html”,有什么建议吗?
答案1
我发现,这是 home 部分,它将自动创建 samba 用户的主目录到共享文件夹。由于 /var/www/html 是我的 apache 用户的主目录,因此会产生重复
[homes]
comment = Home Directories
valid users = %S, %D%w%S
browseable = No
read only = No
inherit acls = Yes