Skip to content
↳ root.AIFLUX / LINUX
BG

πŸ“ $ samba - Samba Setup in Debian 12

This guide explains step by step how to set up a Samba server on Debian 12, using the directory /rack with three subdirectories: shared, martin, and marian. The setup will allow:

1️⃣ Install Samba

sudo apt update
sudo apt install samba samba-common-bin

2️⃣ Create folder structure

sudo mkdir -p /rack/shared
sudo mkdir -p /rack/martin
sudo mkdir -p /rack/marian

3️⃣ Create users and passwords

sudo adduser martin
sudo smbpasswd -a martin

sudo adduser marian
sudo smbpasswd -a marian

4️⃣ Set folder permissions (Linux)

sudo chown -R nobody:nogroup /rack/shared
sudo chmod -R 0777 /rack/shared

sudo chown -R martin:martin /rack/martin
sudo chmod -R 0755 /rack/martin

sudo chown -R marian:marian /rack/marian
sudo chmod -R 0755 /rack/marian

5️⃣ Edit /etc/samba/smb.conf

In Samba, you can set valid users and who has read only, write only, or write list access. See the example below:

[shared]
  path = /rack/shared
  browseable = yes
  read only = no
  guest ok = yes
  create mask = 0777
  directory mask = 0777

[martin]
  path = /rack/martin
  valid users = martin @users
  read only = yes
  write list = martin
  create mask = 0755
  directory mask = 0755

[marian]
  path = /rack/marian
  valid users = marian @users
  read only = yes
  write list = marian
  create mask = 0755
  directory mask = 0755

πŸ’‘ Explanation of parameters:

6️⃣ Restart Samba service

sudo systemctl restart smbd.service

7️⃣ Access from Windows

\\your-server-ip\shared
\\your-server-ip\martin
\\your-server-ip\marian

"A stable shared structure is the foundation of every digital workshop. Samba is the bridge between machines - and between people."

root - Toni Angelchovski
THE SANCTUARY CONSTELLATION
↳root.THE HUMAN KERNEL
SELECT A PORTAL

Follow
your curiosity.

Every light is a doorway into the Sanctuary. Choose a portal in the constellation.

~/sanctuaryA green ring marks the portals you have discovered.
WHERE WILL CURIOSITY TAKE YOU?
↑ ↓   choose   ↡   open ESC   close