✅ What is Samba Server?
Samba is an open-source software that allows Linux/Unix systems to share files and printers with Windows systems using the SMB/CIFS protocol.
👉 In simple words:
Samba = Linux ↔ Windows File Sharing
🔹 Features of Samba
- 📂 File sharing between Linux and Windows
- 🖨️ Printer sharing
- 👤 User authentication
- 🌐 Works with Windows Active Directory
- 🔐 Secure password-based access
🔹 Samba Architecture
Main services:
- smbd โ File & printer sharing service
- nmbd โ NetBIOS name service
- winbindd โ User authentication (for AD integration)
Main configuration file:
/etc/samba/smb.conf
🚀 Install Samba Server in Ubuntu
Step 1: Update system
sudo apt update
Step 2: Install Samba
sudo apt install samba -y
Step 3: Check installation
samba --version
📁 Create a Shared Folder
Step 1: Create directory
sudo mkdir /sharedfolder
Step 2: Set permissions
sudo chmod 777 /sharedfolder
⚙️ Configure Samba
Edit configuration file:
sudo nano /etc/samba/smb.conf
Add at the bottom:
[MyShare]
path = /sharedfolder
browseable = yes
writable = yes
guest ok = yes
read only = no
Save and exit.
🔄 Restart Samba Service
sudo systemctl restart smbd
Check status:
sudo systemctl status smbd
👤 Create Samba User (Secure Method)
sudo adduser username
sudo smbpasswd -a username
💻 Access Samba Share from Windows
- Press Windows + R
- Type:
\\Linux-IP-Address
Example:
\\192.168.1.10