更新和解决方案

更新和解决方案

我在同一网络上有两台计算机,直到最近,两台计算机都可以安装网络驱动器。有些事情发生了变化,现在只有一台机器可以连接。

mount p-drive用于在两台机器上按预期工作。现在我的 Debian 笔记本电脑响应如下:

mount --verbose p-drive

Password for USER@//ADDRESS/Users_S$/USER/:  ****
mount.cifs kernel mount options:   ip=XXX.XXX.XXX.XXX,unc=\\ADDRESS,noauto,uid=1000,gid=1000,user=USER,prefixpath=USER/,pass=****
mount error(95): Operation not supported
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

为了进行比较,这是我的 Ubuntu 14 计算机上的报告,该计算机成功安装了驱动器:

安装 --verbose p 驱动器

Password for USER@//ADDRESS/Users_S$/USER/: **** 
mount.cifs kernel mount options: ip=XXX.XXX.XXX.XXX,unc=\\ADDRESS,noauto,uid=223159,gid=10513,user=USER,prefixpath=USER/,pass=****

这里和其他地方有很多关于这个特定错误的问题,其中许多都涉及mount.cifs.我认为这是为工作机器和非工作机器设置的,如下所示。

另外,我尝试以普通用户和 root 身份进行安装,这两种情况下的结果是相同的。我还尝试添加选项“vers=3.0”和“sec=ntlm”,如其他一些线程中的建议,没有任何更改。

鉴于我在两台机器上使用相同的配置,并且直到最近(几周)它都在两台机器上工作,我假设该问题是由于 mount.cifs 版本 6.0 和 6.7 或内核 4.4 和 4.13 之间的某些变化造成的。

我已经阅读了许多与此相关的其他问题,但我不明白所提供的详细信息,或者它如何适用于我的情况。任何建议将非常受欢迎!

更新和解决方案

的输出dmesg提供了我需要的线索 -vers=1.0在较新的计算机上添加该选项,我猜这会告诉最新版本的 mount.cifs 使用较旧的协议。推测较旧的 Ubuntu 机器仅使用较旧的协议,因此不需要设置该选项。

工作机规格:

系统表

//ADDRESS/Users_S$/USER/     /HOME/p-drive      cifs    noauto,users,user=USER,uid=USER,rw     0       0

(注意我这里本地机和远程机上的用户名是一样的,USER)

uname -a

Linux XXXX 4.4.0-97-generic #120~14.04.1-Ubuntu SMP Wed Sep 20 15:53:13 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

挂载.cifs -V:

6.0

ls -lh /sbin/mount.cifs

-rwsr-xr-x 1 root root 35K Jun 27  2013 /sbin/mount.cifs

dmesg 输出

[1718195.879486] CIFS VFS:自动禁用 \ADDRESS$ 上服务器 inode 编号的使用。该服务器似乎无法正确支持它们。此安装无法识别硬链接。考虑使用“noserverino”选项安装以静默此消息。

非工作机规格:

文件系统表:

//ADDRESS/Users_S$/USER/           /HOME/p-drive       cifs    noauto,users,user=USER,uid=LOCAL_USER,rw      0       0

(对于本机,我的本地用户名 (LOCAL_USER) 与我在远程计算机上的用户名 (USER) 不同)

uname -a

Linux 4.13.0-1-amd64 #1 SMP Debian 4.13.4-2 (2017-10-15) x86_64 GNU/Linux

挂载.cifs -V:

6.7

ls -lh /sbin/mount.cifs

-rwsr-xr-x 1 root root 35K Mar  8  2017 /sbin/mount.cifs

dmesg 输出

[15873.139891] CIFS VFS:服务器不支持方言。考虑在挂载时指定 vers=1.0 或 vers=2.1 以访问旧服务器
[15873.139902] CIFS VFS:cifs_mount 失败,返回代码 = -95

答案1

正如错误消息所说man mount.cifs

OPTIONS
    username=arg
       specifies the username to connect as. If this is not given, then
       the environment variable USER is used.

       Earlier versions of mount.cifs also allowed one to specify the
       username in a "user%password" or "workgroup/user" or
       "workgroup/user%password" to allow the password and workgroup to be
       specified as part of the username. Support for those alternate
       username formats is now deprecated and should no longer be used.
       Users should use the discrete "password=" and "domain=" to specify
       those values. While some versions of the cifs kernel module accept
       "user=" as an abbreviation for this option, its use can confuse the
       standard mount program into thinking that this is a non-superuser
       mount. It is therefore recommended to use the full "username="
       option name.

因此,您必须使用username=代替user=password=代替pass=

答案2

您可能会发现它dmesg提供了一些附加信息。 (该dmesg命令访问来自内核的最新消息系列。通常这些消息在日志文件(例如/var/log/kern.log或)中更容易访问/var/log/syslog。)

在你的情况下,我看到这些是相关消息

[15873.139891] CIFS VFS: Dialect not supported by server. Consider specifying vers=1.0 or vers=2.1 on mount for accessing older servers
[15873.139902] CIFS VFS: cifs_mount failed w/return code = -95

这里的解决方案与消息中建议的完全一样:将vers=1.0或附加vers=2.1到安装选项。 (这控制 SMB/CIFS 协议版本。)请参阅Debian/Stretch 的手册页

相关内容