我一直在使用 Ubuntu 14.04 下的 Samba 4.3.11-Ubuntu 托管一些公共和访问受控的共享文件夹(位于外部驱动器上)。效果非常好,完全符合我的小型办公室的需要。
运行 14.04 的机器崩溃了,所以我用一台更新的机器替换了它,在该机器上我安装了 Ubuntu 18.04 和可从 获得的最新版本的 Samba apt
,即 Samba 4.7.6-Ubuntu。
smb.conf
现在,在我的 Ubuntu 14.04/Samba 4.3.11 设置上完美运行的同一个文件不是在我的 18.04 设置上工作。
事实上,仅有的我可以让任何 Samba 用户拥有任何访问权限的方法是,如果我让他们成为文件中的管理员用户smb.conf
,那么下面 conf 文件中部分admin users
中的定义[global]
之前已被注释掉。如所述,取消注释以允许我的用户访问。
我已经尝试使该[global]
部分变得简单,仅将其简化为日志文件定义。
会发生什么?这是 conf 文件:
# Samba config file
# From UNKNOWN
# Date: 2018/01/01 00:01:26
[global]
workgroup = safeserver
netbios name = safeserver
server string = SAFE File Server: %L
#interfaces = eth0, lo, wlan0
inherit acls = Yes
inherit permissions = Yes
dns proxy = no
obey pam restrictions = Yes
pam password change = Yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
unix password sync = Yes
admin users = drusmor, jadams, bfranklin, gwashington, ugrant
#admin users = drusmor
invalid users = ccoolidge
log file = /var/log/samba/%m.log
log level = 1 winbind:5
max log size = 1000
#smb ports = 139
#name resolve order = bcast lmhosts host wins
logon path = \\safeserver\profiles\.msprofile
logon drive = P:
logon home = \\safeserver\%U\.9xprofile
# Makes this box the master file server
#os level = 254
#preferred master = No
#domain master = Yes
wins support = Yes
panic action = /usr/share/samba/panic-action %d
# nodelay is default, increasing buf size helps speed, keepalive closes
# dead connections and returns memory to system.
#socket options = TCP_NODELAY SO_RCVBUF=65536 SO_SNDBUF=65536 SO_KEEPALIVE
# Set to cleanup dead connections quickly
deadtime = 15
load printers = no
printable = no
[homes]
# Added by DAR on 8 Feb 2018
comment = Home Directories (on external shared drive)
#invalid users = root, bin, daemon, nobody, named, sys, tty, disk, mem, kmem
valid users = %S
path = /media/safeserver/externaldrive/homes/%U
read only = no
guest ok = no
create mask = 0700
directory mask = 0700
store dos attributes = yes
browseable = no
[nbackup]
# Added by DAR on 15 Feb 2018
comment = Local Backup
#invalid users = root, bin, daemon, nobody, named, sys, tty, disk, mem, kmem
valid users = drusmor
path = /media/safeserver/LOCAL_BACKUP
read only = no
guest ok = no
create mask = 0700
directory mask = 0700
store dos attributes = yes
browseable = no
[profiles]
comment = Network Profiles Service
path = %H
read only = no
guest ok = no
create mask = 0600
directory mask = 0700
store dos attributes = yes
browseable = no
#[printers]
# comment = All Printers
# path = /var/spool/samba
# create mask = 0700
# printable = yes
# browseable = no
#
#[print$]
# comment = Printer Drivers
# path = /var/lib/samba/printers
[shared]
comment = SAFE Shared Directories
path = /media/safeserver/externaldrive/serve
invalid users = root, bin, daemon, nobody, named, sys, tty, disk, mem, kmem
valid users = @users
read only = no
guest ok = no
create mode = 0664
directory mode = 0770
#inherit acls = yes
writeable = yes
[Training]
comment = SAFE Training Materials
path = /media/safeserver/externaldrive/serve/Training
#valid users = drusmor, gwashington, ugrant
valid users = @Exec
invalid users = jadams, bfranklin
force group = Exec
read only = no
guest ok = no
browseable = yes
public = no
create mode = 0664
directory mode = 0770
inherit acls = yes
writeable = yes
[Recipes]
comment = SAFE Recipes
path = /media/safeserver/externaldrive/serve/Recipes
#valid users = drusmor, gwashington, ugrant
valid users = @Recipes
invalid users = jadams, bfranklin
force group = Recipes
read only = no
guest ok = no
browseable = yes
public = no
create mask = 0664
directory mask = 0770
inherit acls = yes
Writeable = yes
[Transferral]
comment = CEO Transfer
path = /media/safeserver/externaldrive/Transferral
valid users = @ceotransfer
invalid users = gwashington, ugrant, jadams, bfranklin
force group = ceotransfer
read only = no
guest ok = no
browsable = yes
public = no
create mask = 0664
directory mask = 0770
inherit acls = yes
Writable = yes
感谢您的帮助。