新服配置(四) mount.cifs 失败 mount error(13): Permission denied

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/jingxia2008/article/details/50218933

服务器数据需要备份,备份存储在网络硬盘上,这块硬盘格式 ext4 , 来源于 Windows server 服务器。

然而使用 cifs 挂载失败,老是提示没有权限,我反复在 Windows 系统下测试,用户密码千真万确,然而在 ubuntu 上就是无法成功挂载。

最后终于找到问题的根本原因,密码 hash 格式不对,这样系统一直回报密码错误:


[602334.718574] CIFS VFS: cifs_mount failed w/return code = -13


解决办法,在参数列表里面加上 hash 格式:


      sec=
           Security mode. Allowed values are:

           ¡¤   none - attempt to connection as a null user (no name)

           ¡¤   krb5 - Use Kerberos version 5 authentication

           ¡¤   krb5i - Use Kerberos authentication and forcibly enable packet signing

           ¡¤   ntlm - Use NTLM password hashing

           ¡¤   ntlmi - Use NTLM password hashing and force packet signing

           ¡¤   ntlmv2 - Use NTLMv2 password hashing

           ¡¤   ntlmv2i - Use NTLMv2 password hashing and force packet signing

           ¡¤   ntlmssp - Use NTLMv2 password hashing encapsulated in Raw NTLMSSP message

           ¡¤   ntlmsspi - Use NTLMv2 password hashing encapsulated in Raw NTLMSSP message, and force
               packet signing

           The default in mainline kernel versions prior to v3.8 was sec=ntlm. In v3.8, the default
           was changed to sec=ntlmssp.

           If the server requires signing during protocol negotiation, then it may be enabled
           automatically. Packet signing may also be enabled automatically if it's enabled in
           /proc/fs/cifs/SecurityFlags.



我这里是 sec=ntlm


完整的可以工作的命令行:

mount -v -t cifs  //192.168.2.88/data /media/backup/ -o username=backup,password=backup,iocharset=utf8,sec=ntlm

还需要注意的是用户所在 domain , 我这里是系统内用户,否则要加上 domain , 不然也会报 权限问题


猜你喜欢

转载自blog.csdn.net/jingxia2008/article/details/50218933