/etc/fstab 中的 CIFS 挂载在 14.04 中有效,但在 16.04 中无效

/etc/fstab 中的 CIFS 挂载在 14.04 中有效,但在 16.04 中无效

我正在配置一台 16.04 服务器来替换 14.04 服务器,并在通过 /etc/fstab 安装 CIFS 驱动器时遇到奇怪现象。这是我在两台机器上的 fstab 条目:

//192.168.0.10/share    /mnt/share    cifs    username=myuser,noauto 0 0

在 14.04 上,如果我输入“sudo mount /mnt/share”,系统会提示我输入 samba 帐户密码,然后挂载成功。在 16.04 上输入相同的命令,我得到的却是:

mount: //192.168.0.10/share is write-protected, mounting read-only
mount: cannot mount //192.168.0.10/share read-only

如果我查看系统日志,我会看到以下内容:

Apr  6 10:13:37 localhost kernel: [63103.182822] Status code returned 0xc000006d NT_STATUS_LOGON_FAILURE
Apr  6 10:13:37 localhost kernel: [63103.182829] CIFS VFS: Send error in SessSetup = -13
Apr  6 10:13:37 localhost kernel: [63103.183097] CIFS VFS: cifs_mount failed w/return code = -13
Apr  6 10:13:37 localhost kernel: [63103.191019] Status code returned 0xc000006d NT_STATUS_LOGON_FAILURE
Apr  6 10:13:37 localhost kernel: [63103.191026] CIFS VFS: Send error in SessSetup = -13
Apr  6 10:13:37 localhost kernel: [63103.191285] CIFS VFS: cifs_mount failed w/return code = -13

16.04 系统不会提示我输入 samba 帐户密码,因此身份验证当然会失败。此外,如果我将密码输入 16.04 服务器上的 /etc/fstab 条目,则挂载会成功。问题的关键似乎是 16.04 不再提示输入密码;我该如何恢复该功能?

答案1

原来这是因为没有安装 cifs-utils。我不明白为什么只要密码在 /etc/fstab 中,没有这个包就可以正常挂载 cifs 驱动器,但安装后我得到了正确的密码提示。

相关内容