我可以通过以下方式安装驱动器,没问题:
mount -t cifs //nas/home /mnt/nas -o username=username,password=pass\!word,uid=1000,gid=100,rw,suid
但是,如果我尝试通过 fstab 挂载它,则会出现以下错误:
//nas/home /mnt/nas cifs iocharset=utf8,credentials=/home/username/.smbcredentials,uid=1000,gid=100 0 0 auto
.smbcredentials 文件如下所示:
username=username
password=pass\!word
注意!在我的密码中......我在两种情况下都在逃避
:set noeol binary
我还确保使用Mount CIFS Credentials File has Special Character的文件中没有 eol
chmod
关于 .credentials 文件是0600
并且chown
是root:root
文件在~/
为什么我进入一侧而不是 fstab?
我在 ubuntu 12 LTE 上运行,mount.cifs -V 给我 mount.cifs 版本:5.1
任何帮助和建议将不胜感激......
更新:
/var/log/syslog
显示以下
[26630.509396] Status code returned 0xc000006d NT_STATUS_LOGON_FAILURE
[26630.509407] CIFS VFS: Send error in SessSetup = -13
[26630.509528] CIFS VFS: cifs_mount failed w/return code = -13
更新 2
通过 fstab 使用 strace mount 进行调试:
strace -f -e trace=mount mount -a
Process 4984 attached
Process 4983 suspended
Process 4985 attached
Process 4984 suspended
Process 4984 resumed
Process 4985 detached
[pid 4984] --- SIGCHLD (Child exited) @ 0 (0) ---
[pid 4984] mount("//nas/home", ".", "cifs", 0, "ip=<internal ip>,unc=\\\\nas\\home"...) = -1 EACCES (Permission denied)
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Process 4983 resumed
Process 4984 detached
通过终端挂载
strace -f -e trace=mount mount -t cifs //nas/home /mnt/nas -o username=user,password=pass\!wd,uid=1000,gid=100,rw,suid
Process 4990 attached
Process 4989 suspended
Process 4991 attached
Process 4990 suspended
Process 4990 resumed
Process 4991 detached
[pid 4990] --- SIGCHLD (Child exited) @ 0 (0) ---
[pid 4990] mount("//nas/home", ".", "cifs", 0, "ip=<internal ip>,unc=\\\\nas\\home"...) = 0
Process 4989 resumed
Process 4990 detached
这是我错过的可变用户名的错字。正如您从 strace 调用中看到的那样,不知何故s丢失了: