Ubuntu挂载samba命令、报错信息
mount -t cifs -o dir_mode=0755,file_mode=0755,username=bak,password='backup',uid=111,gid=118 //nas/nfsbackup /backup
查看cifs软件包
dpkg --get-selections | grep cifs-utils
dpkg-query -l cifs-utils
安装cifs-utils包
apt-get install cifs-utils
挂载samba
mount -t cifs -o dir_mode=0777,file_mode=0777,username=bak,password='backup',uid=111,gid=118,rw //10.9.13.33/nfsbackup /backup
抛出错误:
root@ubuntu:~# mount -t cifs -o dir_mode=0777,file_mode=0777,username=bak,password='backup',uid=111,gid=118,rw //10.9.13.33/nfsbackup /backup
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
配置安全认证参数“sec”,参数说明
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.
安全认证模式的挂载命令
mount -t cifs -o dir_mode=0777,file_mode=0777,username=bak,password='backup',uid=111,gid=118,rw,sec=ntlm //10.9.13.33/nfsbackup /backup
挂载完成