Setup a Samba Fileshare on Debian

I use the commands below to setup a Samba network share on my local server.

# Install Samba:
sudo apt install --assume-yes samba

# Say no to any prompts about WINS.

# Add Samba user:
sudo adduser jprice

# Set the password for the user:
sudo smbpasswd -a jprice

# Create the fileshare directory:
sudo mkdir --parents /srv/my
sudo chown --recursive jprice:jprice /srv/my

# Add config to /etc/samba/smb.conf:
[my]
    comment = My File Share
    path = /srv/my
    read only = no
    browsable = yes

# Restart Samba:
sudo systemctl restart smbd

# Add a firewall rule:
sudo ufw allow samba

# Restart Samba
sudo systemctl restart smbd

You can then connect as below.

smb://<ip-address>/my

About

I'm a technology professional who's been passionate about computers since my Grandad introduced me to an Intel 386 back in the 90s when I was a kid. Those moments inspired a passion within for technology, and I've been playing around with anything with a circuit board ever since. Whenever I have a moment you can probably find me working on something computer-related, and this is where I like to write about those moments.