运维中常遇到类似需求,在windows(192.168.2.212)上创建了一个共享盘,设置了共享权限对本地账户test可读可写,然后在Linux端创建挂载点/share,然后执行mount -t cifs //192.168.2.212/test /share -o username=test,password=Pass1234,但提示以下信息:

mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

检查拼写都没问题,查询发现是安全策略的问题,根据man mount.cifs中关于安全模式的描述,内核3.8默认使用的是ntlmssp,其余使用的是ntlm,我这里查询内核是3.10.0-327.el7.x86_64(执行uname -a可以查看),选用了ntlm,最终语句是mount -t cifs //10.15.2.212/test /share -o username=test,password=Pass1234,sec=ntlm,执行成功。

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.

GitHub 加速计划 / li / linux-dash
9
1
下载
A beautiful web dashboard for Linux
最近提交(Master分支:7 个月前 )
186a802e added ecosystem file for PM2 4 年前
5def40a3 Add host customization support for the NodeJS version 4 年前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐