使用 SMB 2.1 或更高版本挂载 Windows Share

Oli*_*mer 14 security cifs file-sharing

我正在尝试使用 Ubuntu 12.04(使用内核 3.13.0-117-generic)挂载 Windows 托管的 SMB 共享(CIFS)。使用 SMB1 挂载是可行的,但这是不可接受的,我们必须改为使用 SMB2.1 或更高版本进行挂载。

以下是我通过传递 ver= 参数尝试执行此操作的输出

root@----:/# mount -t cifs //SERVER/smbtest /mnt/smbtest --verbose -o ver=2.1,user=administrator
Password:
mount.cifs kernel mount options: 
ip=10.16.0.40,unc=\\server.domain.net\smbtest,ver=2.1,ver=1,user=administrator,pass=********
mount error(22): Invalid argument
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Run Code Online (Sandbox Code Playgroud)

如您所见,mount.cifs 内核挂载选项中有两个 ver 参数,一个是我指定的,另一个是默认值 (1)。如果我为版本指定 1 或 1.0 以外的任何内容,就会发生这种情况。

已安装 cifs-utils 5.1 版,cifs.ko 为 2.02 版。从 Samba wiki 上的 SMB3 内核状态页面https://wiki.samba.org/index.php/SMB3_kernel_status,

"The minimum version for use of the Linux kernel SMB3 support is kernel version 3.12 (or backport of cifs.ko module version 2.02 or later) but kernel version 3.18 or later (or equivalent, ie cifs module version 2.04 or later) is recommended for best SMB3 support."
Run Code Online (Sandbox Code Playgroud)

任何人都可以帮助我走上正轨吗?我肯定错过了什么。还有哪些其他方法可用于强制 SMB2+ 连接?这是我在这里的第一篇文章,我尽量保持简短,如果我错过了什么,请告诉我,我会将信息添加到我的帖子中。

据我所知,这应该可行,但如果我误解了某些内容并且不支持 SMB2+,我不会感到惊讶。

谢谢

编辑:我知道 12.04 是 EOL。明天我将使用 14.04 的相关信息更新这篇文章,它有同样的问题。如果有人可以回答:12.04,那仍将不胜感激。

小智 10

如果我使用 ver,它确实输入了“无效参数”,但 man mount.cifs 说选项名称是“vers”,而不是“ver”。

       vers=
       SMB protocol version. Allowed values are:

       ·   1.0 - The classic CIFS/SMBv1 protocol. This is the default.

       ·   2.0 - The SMBv2.002 protocol. This was initially introduced in
           Windows Vista Service Pack 1, and Windows Server 2008. Note
           that the initial release version of Windows Vista spoke a
           slightly different dialect (2.000) that is not supported....
Run Code Online (Sandbox Code Playgroud)

它在 Mint 18.1 中对我有用:

mount -t cifs //192.168.1.1/public /home/user/Desktop/share --verbose -o vers=2.1,user=winuser
Run Code Online (Sandbox Code Playgroud)