mount.cifs 不能使用 smbclient 使用的相同凭证文件

Bra*_*ley 10 linux samba cifs smb

我正在尝试将 NetApp CIFS 共享挂载到我们的一台服务器上,但我不断将“权限被拒绝”打印到 stderr 并NT_STATUS_WRONG_PASSWORD打印到正在运行的dmesg.

root@xxxehpvld05 ~ $ mount.cifs -vv //zhp-nas.xxx.com/perspectives /mnt/secure/cifs -o credentials=/etc/cifs.creds
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
root@xxxehpvld05 ~ $ dmesg | tail
CIFS VFS: cifs_mount failed w/return code = -13
Status code returned 0xc000006a NT_STATUS_WRONG_PASSWORD
CIFS VFS: Send error in SessSetup = -13
CIFS VFS: cifs_mount failed w/return code = -13
Status code returned 0xc000006a NT_STATUS_WRONG_PASSWORD
CIFS VFS: Send error in SessSetup = -13
CIFS VFS: cifs_mount failed w/return code = -13
Status code returned 0xc000006a NT_STATUS_WRONG_PASSWORD
CIFS VFS: Send error in SessSetup = -13
CIFS VFS: cifs_mount failed w/return code = -13
Run Code Online (Sandbox Code Playgroud)

smbclient但是,该命令使用完全相同的凭据文件可以正常工作:

root@xxxehpvld05 ~ $ smbclient -L //zhp-nas.xxx.com/perspectives -A /etc/cifs.creds
Domain=[XXX] OS=[Windows 5.0] Server=[Windows 2000 LAN Manager]

        Sharename       Type      Comment
        ---------       ----      -------
        IPC$            IPC       Remote IPC
        ZHPSubmit-dev   Disk
    [...snip...]
Run Code Online (Sandbox Code Playgroud)

似乎如果一个工作另一个也应该如此,特别是因为凭据文件还指定了域名。

cot*_*eyr 7

没有更多信息,我不能肯定地说,但是在连接到运行旧协议版本的旧 Windows 服务器时,我已经看到了这个问题。请记住,CIFS 被认为是 SMB 的“方言”(类型)。还有其他类型和较旧的设置不使用 CIFS。

基本上就像说两个人在说话。一个西班牙语和一个英语,你试图强迫说英语的人在他显然不懂西班牙语的情况下。

SMBclient 使用不同的方言进行安全协商。(或至少检测不同)。

尝试

mount -t cifs //path/thing/ /mount/point -o username=user,password=pass, sec=ntlm

看看会发生什么。(sec=ntlm 是重要的部分)