Hey I have a somewhat strange problem. I am unable to create a public sambe share on an ext4 filesystem. The shares with authentication as well as the public share on an ntfs volume work.

Here is the output of 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.

Press enter to see a dump of your service definitions

# Global parameters                                                                    
        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

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

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

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

Heres the relevant output of 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"

An the outputs of ls -alto see the permissions of the directories:

$ 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

I thought it could be the permissions of the directories, but everyone can read them, so the user nobody should be able to read them as well.

  • Contrary to your assertion, not everyone can read the directories: Medien, Download and Upload cannot be accessed, while Hörspiele and Musik can be displayed, but not traversed. – AFH Dec 13 '17 at 23:07
  • Thanks for the hint. I did chmod o+rx -R for the public shares. But it's still not working. Medien and Download should not be accessible to the public. But Hörspiele and Musik should be. – Sammy Dec 14 '17 at 8:37
  • I see you have updated the permissions. Which directories are you trying to share? Remember that others cannot access /media/Medien/Musik without having execute permission on /media/Medien, though I don't know how this works in the context of sharing. Which directories are you trying to share? Are you trying to share Hörspiele and Musik separately? What does "not working" mean: an error on setting up the share, an inability to see the share, or access errors on connecting to a visible share? Commands and error codes are needed. – AFH Dec 14 '17 at 10:26
  • @AFH: Thank you very much. It was just the executable permission on the /media/ folder. Now everything works like a charm. – Sammy Dec 14 '17 at 12:30
  • I have posted the solution as an answer, so that others with a similar problem can see that there is a solution. – AFH Dec 14 '17 at 13:26

If you are trying to share Hörspiele and Musik separately, remember that others cannot access /media/Medien/* without having execute permission on /media and /media/Medien.

On a directory, execute permission is needed in order to be able to include it in the path to any of the files contained in it and its subdirectories. With execute and without read permission you can access known files, but you cannot see its contents, though you can see the contents of known subdirectories where you have read permission.

In your case, setting execute permission without read for others will allow read and browse access to /media/Medien/Hörspiele/ and /media/Medien/Musik/ where these names are known, but the files and directories in /media/Medien/ will not be visible.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.