ubuntu 18.04 上挂载 cifs 问题

Edg*_*ars 3 fstab mount cifs

我有两个类似的 Ubuntu 服务器 18.04 (4.15.0-39-generic #42-Ubuntu SMP Tue Oct 23 15:48:01 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux) 并尝试在其上安装 Windows 文件服务器共享。在一台服务器上,它安装没有问题,但在第二台服务器上,由于参数无效错误而失败:

安装错误(22):无效参数 请参阅 mount.cifs(8) 手册页(例如 man mount.cifs)

在两台服务器上执行相同的命令:

mount -t cifs -o username=用户名,domain=域名 //path/to/share /mount/path

内核日志写入这样的消息:

[Tue Dec 4 13:48:36 2018] 安装时未指定方言。默认值已从 CIFS (SMB1) 更改为更安全的方言、SMB2.1 或更高版本(例如 SMB3)。要使用安全性较低的 SMB1 方言来访问不支持 SMB3(或 SMB2.1)的旧服务器,请在挂载时指定 vers=1.0。[2018 年 12 月 4 日星期二 13:48:36] CIFS VFS:cifs_mount 失败,返回代码 = -22

小智 5

内核消息说:默认的 SMB 方言不起作用,您必须指定它。\nmount.cifs 的 MAN 页解释了该选项:

\n\n
   vers=\n       SMB protocol version. Allowed values are:\n       \xc2\xb7   1.0 - The classic CIFS/SMBv1 protocol. This is the default.\n       \xc2\xb7   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\n           Windows Vista spoke a slightly different dialect (2.000) that is not supported.\n       \xc2\xb7   2.1 - The SMBv2.1 protocol that was introduced in Microsoft Windows 7 and Windows Server 2008R2.\n       \xc2\xb7   3.0 - The SMBv3.0 protocol that was introduced in Microsoft Windows 8 and Windows Server 2012.\n       Note too that while this option governs the protocol version used, not all features of each version are available.\n
Run Code Online (Sandbox Code Playgroud)\n\n

因此,您应该尝试找出您的服务器正在使用哪种 SMB 方言,并在命令中指定它

\n\n

例子:

\n\n
mount -t cifs -o username=username,domain=domain-name,vers=1.0 //path/to/share /mount/path\n
Run Code Online (Sandbox Code Playgroud)\n\n

链接到手册页以供进一步参考:https://linux.die.net/man/8/mount.cifs

\n

  • 我已经尝试了所有协议版本,但没有人提供帮助...同样的安装错误。 (5认同)