“Samba is free and open-source software that enables file sharing across different operating systems over a network.” It serves as a Linux implementation alternative to the Windows SMB protocol with four primary functions:
- File & print services
- Authentication and Authorization
- Name resolution
- Service announcement (browsing)
Install Samba Server on Ubuntu
Before installation, update your packages. Install Samba with these commands:
sudo apt-get update
sudo apt-get install samba
Configuring & Creating Your Share Directory
Creating the Share Folder
Create a directory using mkdir:
mkdir /home/username/mysharefolder/
Configuring Share Folder
Edit the Samba configuration file at /etc/samba/smb.conf using nano:
sudo nano /etc/samba/smb.conf
Add the following to the configuration file:
# In the [global] tag add or change the following lines:
server role = standalone server
map to guest = bad user
usershare allow guests = yes
hosts allow = 192.168.0.0/16
hosts deny = 0.0.0.0/0
[linuxsharename]
comment = Samba on Ubuntu shared folder
path = /home/username/mysharefolder
read only = no
guest ok = yes
force user = username
force group = username
Saving, Testing, and Running Samba
Save the file with Ctrl-X. Test the configuration:
testparm
Start the service:
sudo service smbd restart
Update the firewall rules:
sudo ufw allow samba
Accessing Shared Folder From Windows
- Open File Explorer
- Click Network in the left pane
- Enable network discovery if prompted
- Enter
\\followed by the host IP address - Enter server login credentials

Accessing Shared Folder From a Mac
- Choose Go > Connect to Server in Finder
- Enter the network address, for example:
smb://192.168.0.102
- Click Connect
- Select connection type (Guest, Registered User, or Apple ID)
- Enter credentials if needed
The Bottom Line
Setup typically takes no more than 15 minutes and enables cross-platform file sharing between Linux, Windows, and Mac systems.
