Setup Network Shares

Chester Wyke December 03, 2022 Updated: April 15, 2025 #debian

Install Samba

sudo apt install samba

Configure Samba

sudo cp /etc/samba/smb.conf ~
mkdir ~/folder_to_share
sudo nano /etc/samba/smb.conf
sudo service smbd restart

Permissions

IMPORTANT: ENSURE THE USER HAS PERMISSIONS TO ALL PARENT FOLDERS LEADING TO THE SHARED FOLDER.

Permissions are controlled using OS Users and Groups see User and Groups for how to add users and put them into groups. Typically, you’ll want to use special purpose users that are not able to log in locally. Also you probably want to set their logon password to something unusable like a random string of characters.

Set samba password for a user

sudo smbpasswd -a user

See users configured to use samba

Leave off -v if you do not want verbose output

sudo pdbedit -L -v