无法创建公共 Samba 共享

无法创建公共 Samba 共享

嘿,我遇到了一个有点奇怪的问题。我无法在 ext4 文件系统上创建公共 sambe 共享。具有身份验证的共享以及 ntfs 卷上的公共共享都可以正常工作。

以下是输出testparm -S

$ sudo testparm -S
Load smb config files from /etc/samba/smb.conf
Processing section "[Movies]"
Processing section "[Medien]"
Processing section "[Home]"
Processing section "[Musik]"
Processing section "[Hörspiele]"
Processing section "[Upload]"
Loaded services file OK.
Server role: ROLE_STANDALONE

Press enter to see a dump of your service definitions

# Global parameters                                                                    
[global]                                                                               
        server role = standalone server                                                
        map to guest = Bad User                                                        
        obey pam restrictions = Yes                                                    
        pam password change = Yes                                                      
        passwd program = /usr/bin/passwd %u                                            
        passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .                                                    
        unix password sync = Yes
        syslog = 0
        log file = /var/log/samba/log.%m
        max log size = 1000
        min receivefile size = 16384
        load printers = No
        show add printer wizard = No
        dns proxy = No
        usershare allow guests = Yes
        panic action = /usr/share/samba/panic-action %d
        idmap config * : backend = tdb
        aio read size = 16384
        aio write size = 16384
        use sendfile = Yes


[Movies]
        comment = Video's and Movies Folder
        path = /media/Filme
        write list = samuel judith
        force user = samuel
        guest ok = Yes


[Medien]
        comment = Media Folder
        path = /media/Medien
        valid users = samuel judith
        read only = No


[Musik]
        comment = Alle Audio Verzeichnisse
        path = /media/Medien/Musik/
        guest ok = Yes

以下是相关输出blkid

/dev/sda1: LABEL="Filme" UUID="542BCF283D4C91C6" TYPE="ntfs" PARTUUID="cf2765cb-01"
/dev/sdb1: LABEL="Medien" UUID="9081cc55-7f1d-4567-ab43-ddefab6e8e19" TYPE="ext4" PARTUUID="4c80cbf1-a0be-4732-a0de-ba603bc7fa16"

ls -al查看目录的权限的输出:

$ ls -al /media/
insgesamt 8
drwxr-xr-x  1 root   root     68 Aug  5  2016 .
drwxr-xr-x  1 root   root    258 Sep 19  2016 ..
drwxrwxr-x  1 samuel samuel 4096 Jun  7  2017 Filme
drwxrwS--- 12 samuel samuel 4096 Dez 11 22:04 Medien

$ ls -al /media/Medien/
insgesamt 56
drwxrwS--- 12 samuel samuel  4096 Dez 11 22:04 .
drwxr-xr-x  1 root   root      68 Aug  5  2016 ..
drwxrwS---  3 samuel samuel  4096 Jan 25  2017 Download
drwxrwsr-x 35 samuel samuel  4096 Jan 19  2017 Hörspiele
drwxrw----  2 root   root   16384 Jan 22  2016 lost+found
drwxrwsr-x 10 samuel samuel  4096 Jun  2  2016 Musik
drwxrwsr-x  3 samuel samuel  4096 Mai  2  2016 Recording
drwxrwS---  4 samuel samuel  4096 Dez  1  2015 .Trash-1000
drwxrw-rwx 15 samuel samuel  4096 Okt  6 10:49 Upload

我认为这可能是目录的权限,但每个人都可以读取它们,因此用户 nobody 也不应该能够读取它们。

答案1

如果您尝试单独共享HörspieleMusik,请记住其他人/media/Medien/*如果没有/media和的执行权限就无法访问/media/Medien

对于目录,需要有执行权限才能将其包含在其中及其子目录中的任何文件的路径中。在具有执行权限而没有读取权限的情况下,您可以访问已知文件,但无法查看其内容,但您可以查看具有读取权限的已知子目录的内容。

在您的情况下,为其他人设置执行权限而不设置读取权限将允许读取和浏览访问/media/Medien/Hörspiele/以及/media/Medien/Musik/这些名称已知的位置,但其中的文件和目录/media/Medien/将不可见。

相关内容