Skip to content

Set up a Linux Samba server (DEMO)

This guide sets up a Samba file share on Ubuntu or Debian. Command blocks come from [[Reference/index|Reference]] pages.

1. Install Samba

sudo apt update
sudo apt install samba

2. Create the share group

Heading and code block, embedded from the reference page:

Embed error

page 'user-management' not found

3. Create a share user

Code block only, no heading. Use ![[page#^block-id]]:

Embed error

page 'user-management' not found

Then add the user to the Samba database:

sudo smbpasswd -a alice

4. Create the shared folder

sudo mkdir -p /srv/samba/share
sudo chgrp sambashare /srv/samba/share
sudo chmod 2770 /srv/samba/share

5. Configure the share

Add this to the end of /etc/samba/smb.conf:

[share]
   path = /srv/samba/share
   valid users = @sambashare
   read only = no

Restart the service:

sudo systemctl restart smbd

6. Open the firewall

Code block only:

7. Test

From a client:

smbclient //server/share -U alice