How to Install and Configure Samba in Ubuntu

Опубликовано: 18 Июнь 2026
на канале: TheTechWhiz
227
8

This guide provides a comprehensive, step-by-step approach to installing and configuring Samba on an Ubuntu system.





To update your repositories, open your terminal and execute the following command:

sudo apt update

Install Samba:

sudo apt install samba samba-common

Verify Samba installation:

samba –version

Create a Shared Directory:

mkdir /home/freebooter/sambashare/

Configure Samba by opening configuration file:

sudo nano /etc/samba/smb.conf


Scroll to the bottom of the file and add the following lines:


[sambashare]
comment = Samba on Ubuntu
path = /home/freebooter/sambashare
read only = no
browsable = yes

Save the file and exit the editor.


Restart Samba Service:

sudo service smbd restart


Configure Firewall:

sudo ufw allow samba


Set Directory Permissions

sudo chown -R freebooter:sambashare /home/freebooter/sambashare/

Create Samba User:

sudo smbpasswd -a freebooter

Verify Samba Configuration:

testparm

This command tests the syntax of the smb.conf file and reports any issues.


#Samba #Ubuntu #FileSharing #UbuntuTutorial #SambaSetup #TechGuide #Linux #SambaConfiguration #UbuntuTips