我在我的家庭服务器上设置了 Samba 来共享目录。我可以轻松地用我的第一个用户(也是我在服务器上的主要用户)访问 Samba 的网络驱动器。第二个用户根本无法访问这些驱动器中的任何一个。我已经尝试更改这些目录的所有权、删除和创建新用户、更改密码等。
我的smb.conf:
[global]
server role = standalone server
map to guest = never
hosts allow = 192.168.0.0/16
hosts deny = 0.0.0.0/0
security = user
[share]
comment = Test
path = /var/www/extern_drive/samba/share
read only = no
guest ok = no
valid users = first second
force create mode = 0755
force group = smbgroup
[second]
path = /var/www/extern_drive/samba/second
read only = no
guest ok = no
valid users = second
force create mode = 0700
force group = second
我的log.smbd
[2023/12/15 17:31:28.892725, 0] ../../source3/smbd/service.c:168(chdir_current_service)
chdir_current_service: vfs_ChDir(/var/www/extern_drive/samba/second) failed: Permission denied. Current token: uid=1001, gid=1001, 1 groups: 1001
[2023/12/15 17:31:28.896260, 0] ../../source3/smbd/service.c:168(chdir_current_service)
chdir_current_service: vfs_ChDir(/var/www/extern_drive/samba/second) failed: Permission denied. Current token: uid=1001, gid=1001, 1 groups: 1001
[2023/12/15 17:31:30.645442, 0] ../../source3/smbd/service.c:168(chdir_current_service)
chdir_current_service: vfs_ChDir(/var/www/extern_drive/samba/second) failed: Permission denied. Current token: uid=1001, gid=1001, 1 groups: 1001
编辑:
我使用以下命令创建了第二个用户:
$ sudo useradd -d /home/second -s /sbin/nologin second
之后我将用户添加到 sambasmbpasswd -a second