![Ubuntu 14 mount.cifs 带有凭证不起作用](https://linux22.com/image/674717/Ubuntu%2014%20mount.cifs%20%E5%B8%A6%E6%9C%89%E5%87%AD%E8%AF%81%E4%B8%8D%E8%B5%B7%E4%BD%9C%E7%94%A8.png)
我可以通过以下方式安装 Windows 共享驱动器:
mount.cifs //192.168.1.151/_wymiana /mnt/share_2 -o user=wega,password=1234
但我不能这样:
mount.cifs //192.168.1.151/_wymiana /mnt/share_2 -o credentials=/root/.smbcredential_2
cat .smbcredential_2
username=wega
password=1234
使用 strace 进行调试
strace -f -e trace=mount mount -t cifs //192.168.1.151/_wymiana /mnt/share_2 -o credentials=/root/.smbcredential_2
Process 3338 attached
Process 3339 attached
[pid 3339] +++ exited with 0 +++
[pid 3338] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3339, si_status=0, si_utime=0, si_stime=0} ---
[pid 3338] mount("//192.168.1.151/_wymiana", ".", "cifs", 0, "ip=192.168.1.151,unc=\\\\192.168.1"...) = -1 EACCES (Permission denied)
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
[pid 3338] +++ exited with 32 +++
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3338, si_status=32, si_utime=0, si_stime=0} ---
+++ exited with 32 +++
预先感谢您的帮助
答案1
检查并验证您的凭证文件中的用户名和密码后没有任何空格或其他不可见字符。
如果有多余的空格将会改变凭证。
您的cat
命令在用户名输入后显示了几个额外的字符。