User Tools

Site Tools


sambasharetoprivate

This is an old revision of the document!


  • Create Samba Group and Samba Users
sudo groupadd smbusers

# Create system users (optional - or use existing ones)
sudo useradd -G smbusers john
sudo useradd -G smbusers jane

# Set Samba passwords (different from system passwords)
sudo smbpasswd -a john
sudo smbpasswd -a jane
  • Create folder in linux
   sudo mkdir /private
  • Set ownership and permissions
   sudo chown root:smbusers /private
   sudo chmod 1770 /private  # Sticky bit + group access
  • Set ownership (optional)
   sudo chown nobody:nogroup /public
  • Edit Samba config /etc/samba/smb.conf
   [private]
   comment = Private Secure Share
   path = /srv/private
   browseable = yes
   read only = no
   guest ok = no
   valid users = @smbusers
   create mask = 0660
   directory mask = 0770
   force group = smbusers
   # Security settings to prevent users from deleting each other's files
   veto files = /*.exe/*.com/*.bat/*.cmd/
   delete veto files = yes
  • Restart Samba by doing:
   sudo systemctl restart smbd nmbd

   # Or for newer versions:

   sudo systemctl restart smbd winbind
sambasharetoprivate.1762913783.txt.gz · Last modified: by jwan

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki