如何永久挂载具有 root 权限的 samba 共享?我使用过这个常问问题但仍然出现相同的错误。关键是我不想以纯文本形式发送凭证。
用户凭证文件:
username=USER
password=password
domain=sanctuary
smb.conf:
[global]
valid users = USER
browsable = yes
guest ok = no
read only = no
available = yes
public = no
writable = yes
comment = USH
security = user
workgroup = Sanctuary
create mask = 0777
directory mask = 0777
unix password sync = yes
[share]
comment = archive
path = /share
directory mask = 0777
create mask = 0777
fstab 行:
fstab: //192.168.1.50/share /media/share cifs credentials=/etc/samba/user,rw,uid=USER,iocharset=utf8,user,noauto,file_mode=0777,dir_mode=0777 0 0
错误:
mount: wrong fs type, bad option, bad superblock on //192.168.1.50/share,
missing codepage or helper program, or other error
(for several filesystems (e.g. nfs, cifs) you might
need a /sbin/mount.<type> helper program)
In some cases useful info is found in syslog - try
dmesg | tail or so
从连接到服务器nautilus 共享中的菜单安装得很好,但是...仍然没有 root 权限。
更新:
在 fstab 中简化一行以
fstab //192.168.1.50/share /media/share cifs credentials=/etc/samba/user,uid=1000,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0
我收到错误:
mount: only root can mount //192.168.1.50/share on /media/share
更新 2
实际上我已使用以下命令挂载了共享:
sudo apt-get install cifs-utils
但我仍然无法在里面写字 - 说没有权限
更新 3 已解决
问题的根源是权限混乱/未调整
执行
sudo chmod 777 /share
在服务器上提供帮助。
答案1
我通过执行解决了这个问题:
sudo chmod 777 /share
在服务器上。