挂载 samba 共享错误

挂载 samba 共享错误

关注这个 ubuntu指导正在安装受密码保护的网络文件夹,然后收到这样的错误

$ sudo mount -a 
mount error(22):Invalid argument
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

有人可以给我一些建议吗?

这是 fstab 文件

 # /etc/fstab: static file system information.

 #
 # Use 'blkid' to print the universally unique identifier for a

 # device; this may be used with UUID= as a more robust way to name devices

 # that works even if disks are added and removed. See fstab(5).

 #
 # <file system> <mount point>   <type>  <options>       <dump>  <pass>

 # / was on /dev/sda6 during installation
UUID=58b63c7f-9fe8-4422-a571-ebcc726caadc /               ext4    errors=remount-ro 0       1

 # /home was on /dev/sda7 during installation
UUID=04efdfed-5243-498f-ad5d-65119168e122 /home           ext4    defaults        0       2

 # swap was on /dev/sda8 during installation
UUID=0ddb7810-bfec-427d-937d-20ba0dbeb738 none            swap    sw              0       0



 #network drive


//192.168.0.10/HomeData /media/homeshare cifs credentials=/home/sean/.smbcredentials,iocharset=utf8,sec=ntlm 0 0 

答案1

sec=ntlm就是导致错误的原因。只需将其删除即可。

在 14.04 和 18.04 预测试版之间的某个时间点,这个争论消失了。

答案2

如果没有详细信息,您将需要 Windows 计算机的远程 IP 以及其管理员用户名和密码。接下来,您需要确保已正确共享 Windows 文件夹。右键单击相关文件夹,选择属性,单击共享选项卡,单击高级共享按钮,单击共享此文件夹,单击权限,确保“Everyone”具有完全控制权,如果未创建“Everyone”组,请通过添加它来创建,然后授予权限。然后确保您已创建文件~/.smbcredentials并填写用户名和密码行。您还需要确保已在系统中创建挂载点sudo mkdir /mnt/somesharename。接下来,/etc/fstab通过在末尾添加以下行来编辑文件//<ip of remote server>/<name of folder on remote server> /mnt/<name of new remote directory> cifs iocharset=utf8,credentials=/home/username/.smbcredentials,uid=1000,gid=1000,file_mode=0777,dir_mode=0777 0 0

相关内容