Skip to content

Instantly share code, notes, and snippets.

@willwhui
Created December 29, 2017 08:53
Show Gist options
  • Save willwhui/3580cb20e473e297564b2280c327079e to your computer and use it in GitHub Desktop.
Save willwhui/3580cb20e473e297564b2280c327079e to your computer and use it in GitHub Desktop.
在ubuntu上mount一个samba共享目录
@willwhui
Copy link
Author

参见:https://wiki.ubuntu.com/MountWindowsSharesPermanently
按照

Mount password protected network folders
...
Then edit your /etc/fstab file (with root privileges) to add this line (replacing the insecure line in the example above, if you added it):
//servername/sharename /media/windowsshare cifs credentials=/home/ubuntuusername/.smbcredentials,iocharset=utf8,sec=ntlm 0 0
...
sudo mount -a

进行配置之后,出现错误:

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

继续按照文中的方法进行修改

Troubleshooting
...

无效。
最后按照这里:https://ubuntuforums.org/showthread.php?t=1871142&s=ecd1684f44b86d2b814f80517f6f29ed&p=12468646#post12468646
将sec=nlm改为sec=nlmssp

ntlmssp - Use NTLMv2 password hashing encapsulated in Raw
NTLMSSP message

成功了。
可能是因为我的samba共享host是树莓派的原因吧。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment