What Port Does Samba Use?
Samba uses port 445 (TCP) as the primary share port — the same as Windows SMB. Samba is the Linux/Unix implementation of the SMB protocol, allowing Linux machines to share files with Windows computers.
All Samba Share Ports
| Port | Protocol | Purpose |
|---|---|---|
| 445 | TCP | Main Samba/SMB share port |
| 139 | TCP | NetBIOS session service (legacy) |
| 137 | UDP | NetBIOS name service |
| 138 | UDP | NetBIOS datagram service |
How to Open Samba Share Ports on Linux (UFW)
sudo ufw allow 445/tcp
sudo ufw allow 139/tcp
sudo ufw allow 137/udp
sudo ufw allow 138/udp
sudo ufw reload
How to Open Samba Share Ports on Linux (firewalld)
sudo firewall-cmd --permanent --add-service=samba
sudo firewall-cmd --reload
Basic Samba Configuration for File Sharing
Edit /etc/samba/smb.conf:
[shared]
path = /home/user/shared
browseable = yes
read only = no
guest ok = yes
Then restart Samba: sudo systemctl restart smbd
Access Samba Share from Windows
- Open File Explorer on Windows
- In the address bar type:
\LINUX-IPshared - Enter credentials if prompted
Samba Port Blocked? Use Browser-Based Sharing
If port 445 is blocked by your ISP or firewall, use files-share.com — transfers files over HTTPS (port 443) which is open on virtually every network. No Samba configuration needed.
FAQ
What port does Samba use?
Samba uses port 445 (TCP) as the primary share port, plus port 139 (TCP) for legacy NetBIOS connections.
What is the Samba share port number?
Port 445 (TCP). This is the same port used by Windows SMB file sharing.
How do I fix Samba port blocked?
Open port 445 in your firewall (UFW: sudo ufw allow 445/tcp). Or use files-share.com which works over HTTPS without any port configuration.
Can I share files between Linux and Windows without Samba?
Yes. Use files-share.com — upload on Linux, enter the 6-digit key on Windows. No Samba, no port configuration, free up to 10GB.
Samba too complex? files-share.com shares files between Linux and Windows instantly — no config, no ports, free.