Comment by MrDOS

10 hours ago

Some other things I find useful on NASes:

Install avahi-daemon. Samba will automatically register with it to advertise SMB/CIFS to macOS and Linux clients over DNS-SD.

Install wsdd2 so that your server will be auto-discovered by Explorer on Windows 10+ clients with SMB 1.0 disabled, too.

Your Linux hostname is probably lower-case, but by default, Samba publishes a capitalized rendering of the hostname to NetBIOS and Avahi. If this bothers you, set “host-name=something” in the [server] section of /etc/avahi/avahi-daemon.conf, and set “mdns name = mdns” in the [global] section of /etc/samba/smb.conf.

If you have macOS clients, you should enable vfs_fruit in your Samba configuration: https://www.samba.org/samba/docs/current/man-html/vfs_fruit..... There are some compatibility reasons to do this, but mostly it means you can set the “fruit:model” so that your server has a fun icon in the Finder sidebar.

To avoid the creation .DS_Store files, you can disallow them: https://ryanoberto.github.io/blog/2015/04/01/disabling-the-c.... I think you can also set “fruit:resource = xattr” to store Finder preferences in xattrs, but I haven't tried it.

Although macOS deprecated AFP in favour of SMB years ago (and are slated to remove AFP client support altogether in the upcoming macOS 27), SMB client support in macOS is still pretty miserable. The upcoming macOS 27 is set to drop AFP support, but until then I will continue to run Netatalk side-by-side with Samba. Netatalk also registers itself with Avahi, and macOS will (tellingly) use AFP preferentially to SMB, so clients will talk to the right daemon automatically.

For Samba, add a separate entry for the user home directory because the homes directory default triggers some sort of OCD.

  • Yeah, the default [homes] share is really not necessary on a home network where you really just want a common share. On my home storage server, I just have a “files” user, and a corresponding, anonymously readable/writable share:

      [public]
         vfs objects = catia fruit streams_xattr
         fruit:encoding = native
      
         comment = Public share
         path = /home/files
         force user = files
         force group = files
         guest ok = yes
         browseable = yes
         read only = no
         create mask = 0644
         directory mask = 0755
      
         readdir_attr:aapl_max_access = no
    

    The default [homes] share is still there in case I need it for anything, but it's “browseable = no” so it doesn't confuse visitors.