Closed. This question is off-topic。它当前不接受答案。
                            
                        
                    
                
                            
                                
                
                        
                            
                        
                    
                        
                            想改善这个问题吗? Update the question,所以它是on-topic,用于堆栈溢出。
                        
                        5年前关闭。
                                                                                            
                
        
我无法让普通用户访问samba安装。我可以以root用户身份访问安装点,但是普通用户会遇到“权限被拒绝”错误。


服务器正在android CM10.1.3,Samba v3.0.20a上运行(Samba Fileshearing应用,内部版本:140525)
客户端正在运行Fedora 20,Samba客户端v4.1.6


这是mount命令:

sudo mount -t cifs -o credentials=/home/david/.sambacredentials,sec=ntlm,uid=david,gid=david,file_mode=0775,dir_mode=0775 //192.168.1.12/sdcard Documents/


这是错误:

$ ls Documents/
ls: cannot open directory Documents/: Permission denied


这是安装目录权限:

d---rwxr-x. 14 filip filip    0 Jun 26 15:30 Documents/


编辑:smb.conf

[global]
interfaces = wlan0
bind interfaces only = yes
workgroup = WORKGROUP
server string = Samba on Android
netbios name = FILIPSMB
remote announce = 255.255.255.255
encrypt passwords = yes
security = USER
restrict anonymous = 1
load printers = no
printcap name = /dev/null
disable spoolss = yes
deadtime = 5
delete readonly = yes
nt acl support = no
inherit permissions = yes
socket options = SO_SNDBUF=16384 SO_RCVBUF=16384
local master = no
unix extensions = yes

[sdcard]
vfs objects = fake_perms
comment = Android /storage/sdcard0
path = /storage/sdcard0
force user = root
read only = no
writable = yes
guest ok = no

最佳答案

您需要创建一个包含filip和david的公共组。例如,以root身份:

group add smbusers
groupmod -A david smbusers
groupmod -A filip smbusers
chown filip:smbusers /path/to/Documents


文件组应为:

d---rwxr-x. 14 filip smbusers    0 Jun 26 15:30 Documents/


我不建议对文档使用0075的权限,为什么不这样做

chmod 0775 /path/to/Documents


文档组现在将是:

drwxrwxr-x. 14 filip smbusers    0 Jun 26 15:30 Documents/


现在尝试以用户身份重新连接。 (您也可以为valid users中的共享添加smb.conf列表,但现在,让我们以合理的配置获取目录和组。)

您还必须具有Documents是有效的samba共享(对不起,我想您已经做到了)。在smb.conf中,创建一个Documents共享(名称可以是您喜欢的任何名称)。根据您以前的帖子,它看起来类似于此)

[Documents]
        comment = Documents Share
        path = /full/path/to/Documents
        valid users = smbusers # the group you created holding david & filip
        browseable = Yes
        writeable = Yes


编辑smb.conf后,运行testparm,将检查错误并提供您的共享转储。然后重新启动samba(smb和nmb守护程序)。确认david可以通过以下方式访问Documents共享:

smbclient -Udavid -Llocalhost


然后尝试重新连接到文档。 (如果smbclient命令遇到任何问题,则将实际的主机名替换为localhost。(这将表示wins解析失败,要更正,请将以下内容添加到smb.conf的全局部分:

 name resolve order = lmhosts wins host bcast

10-04 23:07