与相似问题不同,我甚至无法与smbclient连接。
samba共享在windows中运行良好,并且自动工作,但在Linux中我根本无法挂载它,错误消息充其量也是神秘的。这是我的samba.conf:
[global]
dos charset = CP437
netbios name = REDACTED
server string = Lab
server role = standalone server
map to guest = Bad User
obey pam restrictions = Yes
smb passwd file = /var/etc/private/smbpasswd
private dir = /var/etc/private
max log size = 51200
server min protocol = SMB2
time server = Yes
deadtime = 15
max open files = 11070
hostname lookups = Yes
load printers = No
printcap name = /dev/null
disable spoolss = Yes
dns proxy = No
pid directory = /var/run/samba
panic action = /usr/local/libexec/samba/samba-backtrace
idmap config * : backend = tdb
acl allow execute always = Yes
create mask = 0666
directory mask = 0777
directory name cache size = 0
kernel change notify = No
map archive = No
map readonly = no
store dos attributes = Yes
strict locking = No
[common]
comment = Lab Common share
path = /mnt/pool/common
read only = No
inherit acls = Yes
hosts allow = XXX.XXX.XX.X/24, XXX.XX.XX.X/24 <-- redacted
hide dot files = No
veto files = /.snap/.windows/.zfs/
vfs objects = zfsacl, streams_xattr, aio_pthread
zfsacl:acesort = dontcare
nfs4:chown = yes
nfs4:acedup = merge
nfs4:mode = special
recycle:subdir_mode = 0700
recycle:directory_mode = 0777
recycle:touch = yes
recycle:versions = yes
recycle:keeptree = yes
recycle:repository = .recycle/%U
错误信息是:
[as@localhost ~]$ sudo mount -t cifs -o username=removed,password=removed //server.ip.address/common /media/windowsshare/
mount error(95): Operation not supported
一条完全无用的信息。
启用调试的dmesg:
[237179.795551] fs/cifs/cifsfs.c: Devname: //132.239.27.172/common flags: 0
[237179.795563] fs/cifs/connect.c: Username: lauria
[237179.795565] fs/cifs/connect.c: file mode: 0x1ed dir mode: 0x1ed
[237179.795600] fs/cifs/connect.c: CIFS VFS: in cifs_mount as Xid: 44 with uid: 0
[237179.795600] fs/cifs/connect.c: UNC: \\132.239.27.172\common
[237179.795605] fs/cifs/connect.c: Socket created
[237179.795606] fs/cifs/connect.c: sndbuf 16384 rcvbuf 87380 rcvtimeo 0x1b58
[237179.795897] fs/cifs/fscache.c: cifs_fscache_get_client_cookie: (0xffff8803e0aa4800/0xffff880035d25580)
[237179.795898] fs/cifs/connect.c: Demultiplex PID: 25817
[237179.795902] fs/cifs/connect.c: CIFS VFS: in cifs_get_smb_ses as Xid: 45 with uid: 0
[237179.795903] fs/cifs/connect.c: Existing smb sess not found
[237179.795907] fs/cifs/cifssmb.c: Requesting extended security.
[237179.795910] fs/cifs/transport.c: For smb_command 114
[237179.795912] fs/cifs/transport.c: Sending smb: smb_len=78
[237179.801062] fs/cifs/connect.c: RFC1002 header 0x25
[237179.801067] fs/cifs/misc.c: checkSMB Length: 0x29, smb_buf_length: 0x25
[237179.801090] fs/cifs/transport.c: cifs_sync_mid_result: cmd=114 mid=1 state=4
[237179.801093] fs/cifs/cifssmb.c: Dialect: 65535
[237179.801094] fs/cifs/cifssmb.c: negprot rc -95
[237179.801097] fs/cifs/connect.c: CIFS VFS: leaving cifs_get_smb_ses (xid = 45) rc = -95
[237179.801100] fs/cifs/fscache.c: cifs_fscache_release_client_cookie: (0xffff8803e0aa4800/0xffff880035d25580)
[237179.801262] fs/cifs/connect.c: CIFS VFS: leaving cifs_mount (xid = 44) rc = -95
[237179.801263] CIFS VFS: cifs_mount failed w/return code = -95
我尝试过许多不同的-sec
选项--它们都失败了,所有的东西都有相同的错误信息。smbclient也没有帮助:
smbclient //132.239.27.172/common -U username%password
protocol negotiation failed: NT_STATUS_INVALID_NETWORK_RESPONSE
这在windows上是如何工作的,而在linux上却完全不起作用呢?
发布于 2014-07-15 22:24:37
好吧,“我”明白了-由于某种原因,加上"vers=3.0“使它起作用。我不知道为什么没有这个就有问题,或者为什么会起作用。但如果其他人对自由职业者的设置有此问题,可供今后参考。
发布于 2017-10-19 18:51:04
要填写来自@Ken和@Paul的答案:当SMB版本高于v1时,需要指定:
mount -t cifs \
-o username=USERNAME,vers=3.0 \
//server/share \
/mnt/point
Linux内核客户机自2.5.42以来就包含在内核中。cifs协议(以及相关的早期SMB方言)是默认的("vers=1.0"),但是可以通过在挂载上指定"vers=2.0“或"vers=2.1”或"vers=3.0“或"vers=3.02”来选择对新方言(SMB2.02、SMB2.1和SMB3和SMB3.02)的支持。-- https://wiki.samba.org/index.php/LinuxCIFSKernel
对于smbclient,咒语是-m, --max-protocol=LEVEL
:
smbclient -L server -U username -m SMB2
我没有找到smbclient允许的级别列表。根据这条线中的Muehlfeld,Windows使用的版本如下:
有几种不同的mount
错误消息可以追溯到不匹配的协议级别。一个非详尽的列表(请随意编辑答案并添加更多内容):
mount error(13): Permission denied
mount error(95): Operation not supported
mount error(121): Remote I/O error
最后,我看到了一些评论,表明经常引用的使用选项sec=ntlmv2
和类似的建议不应该再被遵循。因此,至少不要混合和匹配sec
和vers
可能是个好主意。
发布于 2015-01-26 07:23:55
我已经抗争了一个多月了。客户端为XenServer6.2和6.5时,无法通过CIFS挂载ISO目录。
vers=3.0终于起作用了。
你在哪里找到这个选择的?!
我的域名是Windows2012 R2。我并没有降低注册表中的身份验证要求--它们仍然是默认的(当我发现这一点时,我正准备大范围地打开它)。
我根本不需要指定sec=设置。
我确实需要指定一个域。我在caps中指定了域--可能不需要。
我的命令跟着。
mount -t cifs "//192.168.92.25/shared" -o username=administrator,password=<your_password>,domain=<YOUR DOMAIN IN CAPS>,vers=3\.0 /root/tmp
现在,了解如何向身份验证添加选项。
谢谢保罗不管你是谁。
https://unix.stackexchange.com/questions/144522
复制相似问题