运维中常遇到类似需求,在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
13
2
下载
A beautiful web dashboard for Linux
最近提交(Master分支:3 个月前 )
186a802e added ecosystem file for PM2 5 年前
5def40a3 Add host customization support for the NodeJS version 5 年前
Logo

AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。

更多推荐