mount samba 使文件夹无法访问

发布于 2024-12-22 19:54:00 字数 2080 浏览 3 评论 0原文

我创建了一个文件夹并 770 它;当我尝试挂载 samba 共享时,权限更改为 670,并且无法访问文件夹数据;但如果我“su”我可以访问所有数据。

我的命令是:

sudo smbmount //192.168.1.5/docs /home/my_user/docs -o user=my_user,domain=DOMAIN,uid=my_user,gid=domain_admins

smb.conf 是:

[global]
 workgroup = domain
 netbios name = server
 server string = File Server
 enable privileges = yes
 interfaces = lo,eth0
 bind interfaces only = Yes
 passdb backend = ldapsam:ldapi://%2fvar%2frun%2fslapd%2fldapi
 ldap ssl = Off
 log level = 1
 syslog = 0
 log file = /var/log/samba/%m
 max log size = 50
 vfs objects = full_audit
 full_audit:success = connect opendir open disconnect unlink mkdir rmdir rename
 full_audit:failure = none
 smb ports = 137 138 139 445
 name resolve order = wins bcast hosts
 time server = Yes
 printcap name = CUPS
 wins support = Yes
 dns proxy = Yes
 ldap suffix = dc=aaa,dc=bbb
 ldap machine suffix = ou=Computers
 ldap user suffix =  ou=Users
 ldap group suffix =  ou=Groups
 ldap idmap suffix = ou=Idmap
 ldap admin dn = cn=ccc,dc=aaa,dc=bbb
 map acl inherit = Yes
 printing = cups
 encrypt passwords = Yes
 obey pam restrictions = No
 ldap passwd sync = Yes
 mangling method = hash2
 logon script = logon.bat
 logon drive = Z:
 logon home =
 logon path = \\192.168.1.5\profiles\%U
 domain logons = Yes
 os level = 65
 preferred master = Yes
 domain master = Yes
 add user script = /usr/sbin/smbldap-useradd -m "%u"
 ldap delete dn = Yes
 add machine script = /usr/sbin/smbldap-useradd -w "%u"
 add group script = /usr/sbin/smbldap-groupadd -p "%g"
 add user to group script = /usr/sbin/smbldap-groupmod -m "%u" "%g"
 delete user from group script = /usr/sbin/smbldap-groupmod -x "%u" "%g"
 set primary group script = /usr/sbin/smbldap-usermod -g "%g" "%u"
 hide unreadable = yes

 [docs]
   comment = documents
   path = /home/samba/shares/docs
   valid users = @"users"
   read list = 
   write list = @"users"
   admin users = 
   read only = No
   browseable = Yes
   force create mode = 0660
   force directory mode = 0770
   vfs objects = full_audit

I have created a folder and 770 it; when I try to mount a samba share, permissions are changed to 670 and I cannot access folder data; but if I "su" I can access all the data.

My command is:

sudo smbmount //192.168.1.5/docs /home/my_user/docs -o user=my_user,domain=DOMAIN,uid=my_user,gid=domain_admins

smb.conf is:

[global]
 workgroup = domain
 netbios name = server
 server string = File Server
 enable privileges = yes
 interfaces = lo,eth0
 bind interfaces only = Yes
 passdb backend = ldapsam:ldapi://%2fvar%2frun%2fslapd%2fldapi
 ldap ssl = Off
 log level = 1
 syslog = 0
 log file = /var/log/samba/%m
 max log size = 50
 vfs objects = full_audit
 full_audit:success = connect opendir open disconnect unlink mkdir rmdir rename
 full_audit:failure = none
 smb ports = 137 138 139 445
 name resolve order = wins bcast hosts
 time server = Yes
 printcap name = CUPS
 wins support = Yes
 dns proxy = Yes
 ldap suffix = dc=aaa,dc=bbb
 ldap machine suffix = ou=Computers
 ldap user suffix =  ou=Users
 ldap group suffix =  ou=Groups
 ldap idmap suffix = ou=Idmap
 ldap admin dn = cn=ccc,dc=aaa,dc=bbb
 map acl inherit = Yes
 printing = cups
 encrypt passwords = Yes
 obey pam restrictions = No
 ldap passwd sync = Yes
 mangling method = hash2
 logon script = logon.bat
 logon drive = Z:
 logon home =
 logon path = \\192.168.1.5\profiles\%U
 domain logons = Yes
 os level = 65
 preferred master = Yes
 domain master = Yes
 add user script = /usr/sbin/smbldap-useradd -m "%u"
 ldap delete dn = Yes
 add machine script = /usr/sbin/smbldap-useradd -w "%u"
 add group script = /usr/sbin/smbldap-groupadd -p "%g"
 add user to group script = /usr/sbin/smbldap-groupmod -m "%u" "%g"
 delete user from group script = /usr/sbin/smbldap-groupmod -x "%u" "%g"
 set primary group script = /usr/sbin/smbldap-usermod -g "%g" "%u"
 hide unreadable = yes

 [docs]
   comment = documents
   path = /home/samba/shares/docs
   valid users = @"users"
   read list = 
   write list = @"users"
   admin users = 
   read only = No
   browseable = Yes
   force create mode = 0660
   force directory mode = 0770
   vfs objects = full_audit

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

说不完的你爱 2024-12-29 19:54:02

我前段时间解决了这个问题,忘记在这里发帖了。
我的问题是我的共享文件夹权限,它只是 rw,它应该是 rwx

I solved it some time ago and forgot to post here.
My problem was my shared folder permission, it was just rw, and it should be rwx

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文