14.11.2025

Debian Samba Setup: Complete Configuration Guide for Beginners

Intro

Samba is a powerful open-source solution for file and print sharing that implements the SMB/CIFS protocol originally developed by Microsoft for Windows. It allows seamless interoperability between Linux and Windows systems, enabling users to share files, folders, and printers effortlessly across a local network. Beyond basic file sharing, Samba also supports advanced features such as printer sharing, user authentication, and interprocess communication (IPC). In this guide, we’ll take you through a step-by-step process to configure Samba on a Debian-based system, helping you build a secure, reliable, and efficient file server for your home or office network.

Unlock the power of a stable, secure, and fully customizable VPS with AlmaLinux at Serverspace. Enjoy enterprise-grade performance, full root access, SSD storage, and global deployment options — all without licensing fees. Perfect for developers, businesses, and hosting professionals, our AlmaLinux VPS delivers predictable updates, CentOS compatibility, and effortless scalability. Launch your cloud server today and experience reliable, high-performance Linux hosting made simple.

Installing additional applications

First you need to update the apt cache and install the required software components. Open terminal and paste:

sudo apt update
sudo apt install samba

Screenshot №1 — Installation

The command above will install necessary packages with their dependencies.

Manage Users

When deploy complete, we make and setup consumer to gain resources.
Do it:

sudo useradd -m user1

Change "user1" with the actual username
Upon completion of the creation process, we should create a password:

sudo passwd user1

And then assign the Samba group:

sudo smbpasswd -a user1

Screenshot №2 — New user

Preparing Shared Catalogs

After creating and configuring users, we create shares to which they will have access. Create a folder share1 along the path / media

mkdir /media/share1

Next, edit the Samba configuration file with a text editor, in this case nano:

sudo nano /etc/samba/smb.conf

It is used for creation shared folders, grant access to them, and other important service settings.
Now make new resource and define access rights to it.
Make a folder "share1", set permissions for user1:

[share1]
path = /media/share1
read only = no
guest ok = no
valid users = user1

Screenshot №3 — Configuration

After making these, directory "share1" will be accessible for user1.

Restart Samba

After changing the settings, the service should be restarted:

sudo systemctl restart smbd.service

Screenshot №4 — Status

This command will restart the Samba service and commit any changes made to the configuration.

Availability check

Once configured, you can test access to shared folders from another host on the network. To check from the server itself, you can use the smbclient utility, which should first be installed:

sudo apt install smbclient -y

Let's know your white IP-address with command:

ip a

And then verify:

smbclient -U user1 //[IP_address|Server_name]/share1 -c 'ls'

Or by opening the file manager on another computer and typing in the address bar:

\\Debian_server_IP\share1

"Debian_server_IP" is the IP address of the newly configured server.
If everything was done correctly, then as a result you should see the contents of the "share1" folder. In the Windows you can use Explore.exe which have handler for SMB communications:

Screenshot №5 — Connection

Alright, after that we can use our shared folder under authenticated user1. For more control of user's action you can configure attributes for each! That solution also will be suitable for other distributives like alt Linux with Samba.

You may be also interested in

FAQ