Ubuntu – Create Samba Share

| | | | | | |
sudo apt install samba
cd /etc/samba
sudo cp smb.conf smb.conf.bak
sudo mkdir -p /var/shares/public
sudo chmod 755 -R /var/shares/

echo "[Share]" | sudo tee -a smb.conf
echo "comment = Samba file share." | sudo tee -a smb.conf
echo "path = /var/shares/public/" | sudo tee -a smb.conf
echo "browseable = yes" | sudo tee -a smb.conf
echo "read only = no" | sudo tee -a smb.conf
echo "guest ok = yes" | sudo tee -a smb.conf

All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.