我尝试构建一个 Samba 服务器用于在我的网络中共享文件。主要目标是一个具有两个共享的 samba 文件共享服务器(一个用于来宾访问的“exchange”文件夹,可写,一个文件夹“cifs”仅可供用户“cifs”使用密码访问,可写)和用于 linux 的最新 smb 协议以及 Windows 8.1 及更高版本,完全加密和签名。
我根据我的需要创建了这个 smb.conf:
[global]
workgroup = WORKGROUP
interfaces = eth0
bind interfaces only = yes
ntlm auth = yes
log file = /var/log/samba/log.%m
log level = 3
max log size = 1000
panic action = /usr/share/samba/panic-action %d
server role = standalone server
;passdb backend = tdbsam
;obey pam restrictions = yes
security = user
encrypt passwords = true
invalid users = root
map to guest = bad user
guest account = nobody
read only = yes
smb encrypt = mandatory
server signing = mandatory
client min protocol = SMB2_10
client max protocol = SMB3
[cifs]
comment = CIFS-Share
path = /disks/1TB/cifs/
available = yes
browseable = yes
write list = cifs
guest ok = yes
create mode = 0754
directory mode = 0755
force create mode = 0754
force directory mode = 0755
[exchange]
comment = exchange folder
path = /disks/2TB/exchange/
available = yes
browseable = yes
guest ok = yes
read only = no
我的问题:当我连接 Linux 盒子时,我无法连接。它失败并显示错误消息
WARNING: The "syslog" option is deprecated
Bad SMB2 signature for message
[0000] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
[0000] 1D 6E C7 C8 A5 07 23 F5 4E 9A DF 33 89 36 F7 89 .n....#. N..3.6..
session setup failed: NT_STATUS_ACCESS_DENIED
我用来连接的命令:
smbclient -e //192.168.1.11/exchange --user=guest% -mSMB3
我的环境: lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 9.5 (stretch)
Release: 9.5
Codename: stretch
4.9.0-8-amd64 #1 SMP Debian 4.9.110-3+deb9u4 (2018-08-21) x86_64 GNU/Linux
我的问题:首先,一些化妆品:系统日志已弃用消息:我删除了配置文件中的系统日志条目,但此通知仍然出现。
第二:我无法使用 smbclient 连接到 samba 服务器。我可以毫无错误地连接 nautilus。但是:没有任何内容被加密,没有任何内容被签名。协议是NT1。我不希望任何人使用旧协议进行连接。至少 SMBv2_10 是强制性的。
服务器上的 smbstatus 结果如下:
Samba version 4.5.12-Debian
PID Username Group Machine Protocol Version Encryption Signing
----------------------------------------------------------------------------------------------------------------------------------------
17140 -1 -1 testlinux (ipv4:192.168.6.12:44422) NT1 - -
17140 nobody nogroup testlinux (ipv4:192.168.6.12:44422) NT1 - -
17151 nobody nogroup 192.168.6.12 (ipv4:192.168.6.12:37766) NT1 - -
Service pid Machine Connected at Encryption Signing
---------------------------------------------------------------------------------------------
IPC$ 17140 testlinux Tue Sep 11 10:42:34 2018 CEST - -
exchange 17151 192.168.6.12 Tue Sep 11 10:42:37 2018 CEST - -