As organizations increasingly operate heterogeneous computing environments consisting of Windows desktops, Ubuntu workstations, cloud-hosted virtual machines, and containerized applications, the need for reliable and secure file sharing has become more important than ever. While cloud storage platforms provide collaboration capabilities, many businesses still require on-premise or private network file servers for reasons including security, compliance, performance, cost control, and integration with existing infrastructure.
Samba is the industry-standard open-source implementation of Microsoft's Server Message Block (SMB) protocol. Running on Ubuntu 24.04 LTS, Samba enables Linux systems to function as secure file and print servers that integrate seamlessly with Windows, Linux, and macOS clients. Organizations can build enterprise-grade file sharing solutions without purchasing proprietary Windows Server licenses while benefiting from Linux stability, flexibility, and security.
This tutorial provides a practical introduction to deploying Samba on Ubuntu 24.04 LTS. It explains networking fundamentals, installation procedures, Linux permissions, user authentication, and best practices for creating secure and scalable shared storage. Although intended for beginners, the tutorial also introduces concepts valuable to experienced Linux administrators and DevOps engineers.
Linux Networking with Samba on Ubuntu 24.04 LTS
Part 1 – Foundations, Installation, and Secure Configuration
A Professional Tutorial Paper for Small Businesses, Software Developers, and Enterprise IT
Prepared for: KeenComputer.com & IAS-Research.com
Executive Summary
As organizations increasingly operate heterogeneous computing environments consisting of Windows desktops, Ubuntu workstations, cloud-hosted virtual machines, and containerized applications, the need for reliable and secure file sharing has become more important than ever. While cloud storage platforms provide collaboration capabilities, many businesses still require on-premise or private network file servers for reasons including security, compliance, performance, cost control, and integration with existing infrastructure.
Samba is the industry-standard open-source implementation of Microsoft's Server Message Block (SMB) protocol. Running on Ubuntu 24.04 LTS, Samba enables Linux systems to function as secure file and print servers that integrate seamlessly with Windows, Linux, and macOS clients. Organizations can build enterprise-grade file sharing solutions without purchasing proprietary Windows Server licenses while benefiting from Linux stability, flexibility, and security.
This tutorial provides a practical introduction to deploying Samba on Ubuntu 24.04 LTS. It explains networking fundamentals, installation procedures, Linux permissions, user authentication, and best practices for creating secure and scalable shared storage. Although intended for beginners, the tutorial also introduces concepts valuable to experienced Linux administrators and DevOps engineers.
1. Introduction
Data is one of the most valuable assets within any organization. Engineering drawings, source code repositories, financial documents, multimedia assets, customer records, and research datasets must often be shared among multiple users while maintaining security and version integrity.
In many organizations, employees use different operating systems:
- Windows 11 desktop computers
- Ubuntu development workstations
- macOS laptops
- Docker containers
- Virtual machines
- Cloud servers
Without a common file-sharing protocol, collaboration becomes difficult. Samba addresses this challenge by implementing the SMB/CIFS protocol, allowing Linux systems to communicate naturally with Windows networks.
Ubuntu 24.04 LTS provides an ideal operating system for Samba deployments because of its long-term support, enterprise security updates, modern Linux kernel, and excellent hardware compatibility. Whether deployed on a small Intel NUC, a rack-mounted server, or a virtual machine in a cloud environment, Ubuntu 24.04 offers a dependable platform for centralized file services.
2. Why Ubuntu 24.04 LTS?
Ubuntu 24.04 LTS ("Noble Numbat") is Canonical's latest Long-Term Support release. LTS versions receive five years of standard maintenance and can be extended further with Ubuntu Pro, making them well suited for production systems.
Advantages
- Five years of security updates
- Stable software repositories
- Linux Kernel 6.8
- Modern systemd service management
- Updated Samba 4 packages
- Improved AppArmor security
- Native Docker and virtualization support
- Extensive documentation and community support
For businesses, these characteristics reduce maintenance effort and improve long-term reliability.
Typical Deployment
Internet │ Firewall/Router │ Gigabit Ethernet Switch ┌─────────────┼─────────────┐ │ │ │ Windows 11 Ubuntu Desktop macOS Client Developer PC Laptop │ │ │ └─────────────┼─────────────┘ │ Ubuntu 24.04 LTS Server Samba File Server │ Shared Project Files
This architecture enables all client systems to access a centralized file repository using the SMB3 protocol.
3. Understanding Samba
Samba is an open-source software suite that implements Microsoft's Server Message Block (SMB) networking protocol. SMB allows computers to share files, printers, and other network resources.
Originally developed to provide interoperability between Unix and Windows systems, Samba has evolved into a mature enterprise solution used in educational institutions, government organizations, research laboratories, and commercial enterprises.
Major Samba Components
|
Component |
Purpose |
|---|---|
|
smbd |
File and print services |
|
nmbd |
NetBIOS name services (legacy) |
|
winbindd |
Active Directory integration |
|
smbclient |
Command-line SMB client |
|
testparm |
Configuration validator |
For most small business environments, the smbd service provides everything necessary for secure file sharing.
4. Linux Networking Fundamentals
Before configuring Samba, it is helpful to understand the underlying Linux networking concepts.
IP Address
Every computer connected to a network requires an IP address.
Example:
192.168.1.50
This address uniquely identifies the Ubuntu Samba server.
Hostname
A hostname provides a human-readable name for the server.
Example:
fileserver
Clients can connect using either:
\\fileserver\Shared
or
\\192.168.1.50\Shared
DNS
A Domain Name System (DNS) server converts hostnames into IP addresses. Small networks often use a home router or local DNS service for this purpose.
Network Ports
Samba primarily uses:
|
Port |
Protocol |
|---|---|
|
445 |
SMB over TCP |
|
139 |
NetBIOS (legacy) |
Modern deployments primarily use port 445 with SMB2 or SMB3.
5. Planning Your File Server
Good planning simplifies future expansion.
Recommended Hardware
|
Component |
Recommended |
|---|---|
|
CPU |
Quad-Core Intel or AMD |
|
Memory |
16 GB RAM |
|
Storage |
NVMe SSD |
|
Network |
2.5 Gigabit Ethernet |
|
Backup |
External NAS |
For engineering firms handling CAD models, simulation files, or AI datasets, fast NVMe storage and higher-speed networking significantly improve user experience.
Recommended Directory Structure
/srv/samba/ ├── projects ├── engineering ├── finance ├── backups └── public
Organizing data into separate shares improves access control and simplifies backup strategies.
6. Installing Samba
Update the operating system:
sudo apt update sudo apt upgrade -y
Install Samba:
sudo apt install samba -y
Verify the installation:
smbd --version
Check the service status:
systemctl status smbd
If necessary, enable the service to start automatically:
sudo systemctl enable smbd
7. Creating a Shared Folder
Rather than sharing a user's home directory, create a dedicated location for shared data.
sudo mkdir -p /srv/samba/shared
Create a group for authorized users:
sudo groupadd sambashare
Add your account to the group:
sudo usermod -aG sambashare $USER
Assign ownership:
sudo chown -R root:sambashare /srv/samba/shared
Configure permissions:
sudo chmod -R 2775 /srv/samba/shared
The 2775 mode sets the setgid bit so that all newly created files inherit the sambashare group, making collaboration easier.
8. Configuring Samba
Back up the default configuration before making changes:
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.backup
Edit the configuration file:
sudo nano /etc/samba/smb.conf
Append the following share definition:
[Shared] comment = Company Shared Folder path = /srv/samba/shared browseable = yes read only = no guest ok = no create mask = 0664 directory mask = 2775 valid users = @sambashare force group = sambashare
This configuration:
- Publishes a share named Shared.
- Restricts access to members of the sambashare group.
- Prevents anonymous (guest) access.
- Ensures new files and folders inherit collaborative permissions.
Validate the configuration:
testparm
If no errors are reported, restart Samba:
sudo systemctl restart smbd
9. Creating Samba Users
Linux and Samba maintain separate password databases. After creating or selecting a Linux account, add it to Samba:
sudo smbpasswd -a username
Enable the account:
sudo smbpasswd -e username
Replace username with the appropriate Linux user.
To verify available shares:
smbclient -L localhost -U username
A successful configuration will list the Shared share along with the default administrative shares.
10. Firewall Configuration
Ubuntu uses UFW (Uncomplicated Firewall) by default.
Allow Samba traffic:
sudo ufw allow Samba
Check the firewall status:
sudo ufw status
If the server is deployed in an enterprise network, firewall rules should be limited to trusted internal subnets rather than allowing unrestricted access.
Summary
In Part 1, we established the foundation for building a secure Samba file server on Ubuntu 24.04 LTS. We explored the role of Samba in mixed operating system environments, reviewed Linux networking fundamentals, planned a scalable directory structure, installed the necessary software, created secure shared folders, configured user authentication, and enabled firewall access.
By following these steps, administrators can create a reliable SMB3-based file server suitable for home offices, software development teams, engineering organizations, and small businesses. The use of dedicated Linux groups, secure permissions, and non-guest authentication provides a strong baseline for future expansion.
Part 2 will cover connecting Windows and Ubuntu clients, persistent CIFS mounts, Access Control Lists (ACLs), security hardening, performance tuning, backup and disaster recovery, Docker-based development workflows, troubleshooting, and enterprise deployment best practices, completing the tutorial into a practical production-ready guide.
Linux Networking with Samba on Ubuntu 24.04 LTS
Part 2 – Client Integration, Security Hardening, Performance Optimization, and Enterprise Deployment
A Professional Tutorial Paper for Small Businesses, Software Developers, and Enterprise IT
Prepared for: KeenComputer.com & IAS-Research.com
11. Connecting Windows Clients
One of Samba's greatest strengths is its seamless integration with Microsoft Windows. From the perspective of a Windows user, a Samba share behaves much like a Windows Server file share, enabling organizations to adopt Linux servers without disrupting existing workflows.
Accessing a Share
Open File Explorer and enter the Universal Naming Convention (UNC) path:
\\192.168.1.50\Shared
or, if DNS or local name resolution is configured:
\\fileserver\Shared
Windows will prompt for credentials. Use the Samba username and password created on the Ubuntu server.
Mapping a Network Drive
To make the share permanently available:
- Open File Explorer.
- Select This PC.
- Click Map Network Drive.
- Choose a drive letter (for example, S:).
- Enter the share path.
- Enable Reconnect at sign-in.
- Authenticate with Samba credentials.
This approach provides users with persistent access to shared folders across reboots.
12. Connecting Ubuntu Clients
Linux systems access Samba shares using the CIFS (Common Internet File System) client.
Install the required package:
sudo apt update sudo apt install cifs-utils -y
Create a mount point:
sudo mkdir -p /mnt/shared
Mount the share manually:
sudo mount -t cifs \ //192.168.1.50/Shared \ /mnt/shared \ -o username=tapas,vers=3.1.1
Verify:
df -h
or
mount | grep cifs
If the share mounts successfully, it behaves like a local directory.
13. Automatic Mounting with /etc/fstab
Manual mounting is useful for testing, but production systems should mount shares automatically.
Create Credentials File
nano ~/.smbcredentials
Contents:
username=tapas password=YourPassword
Protect the file:
chmod 600 ~/.smbcredentials
Edit fstab
sudo nano /etc/fstab
Add:
//192.168.1.50/Shared \ /mnt/shared \ cifs \ credentials=/home/tapas/.smbcredentials,\ vers=3.1.1,\ iocharset=utf8,\ uid=1000,\ gid=1000,\ nofail,\ file_mode=0664,\ dir_mode=0775 \ 0 0
Test:
sudo mount -a
No output indicates the configuration is valid.
14. Linux Permissions and Access Control
Samba cannot bypass Linux permissions. Every access request is verified by both Samba and the Linux kernel.
Standard Permissions
chmod chown chgrp
Example:
sudo chown -R root:sambashare /srv/samba/shared sudo chmod -R 2775 /srv/samba/shared
Access Control Lists (ACLs)
ACLs provide more granular permissions than traditional Unix permissions.
Install:
sudo apt install acl
Example:
sudo setfacl -m u:developer:rwx /srv/samba/projects
Display ACLs:
getfacl /srv/samba/projects
ACLs simplify collaboration between multiple departments.
15. Security Hardening
Security should always be considered during deployment.
Disable SMB1
SMB1 is obsolete.
Add to smb.conf:
server min protocol = SMB2 server max protocol = SMB3
Restrict Access
hosts allow = 192.168.1. hosts deny = ALL
Only trusted networks can connect.
Disable Guest Access
guest ok = no
Require authentication:
map to guest = never
Strong Password Policy
Encourage:
- minimum 12 characters
- mixed case
- numbers
- symbols
- periodic password changes
Enable Firewall
sudo ufw allow Samba
Verify:
sudo ufw status
16. Performance Optimization
Proper tuning significantly improves throughput, especially for engineering files, multimedia projects, and AI datasets.
Enable Sendfile
use sendfile = yes
Asynchronous I/O
aio read size = 1 aio write size = 1
Socket Optimization
socket options = TCP_NODELAY IPTOS_LOWDELAY
Modern SMB
Always use SMB3:
server max protocol = SMB3
Hardware Recommendations
|
Component |
Recommendation |
|---|---|
|
CPU |
Quad-Core or better |
|
RAM |
16–32 GB |
|
Storage |
NVMe SSD |
|
Network |
2.5GbE or 10GbE |
|
RAID |
RAID1 or RAID10 |
For organizations working with CAD models, GIS data, software repositories, or AI training datasets, upgrading storage and networking often provides greater performance gains than increasing CPU speed alone.
17. Backup and Disaster Recovery
A file server without backups represents a significant operational risk.
Rsync
Example:
rsync -avh /srv/samba/ /backup/
BorgBackup
Provides:
- deduplication
- encryption
- compression
Suitable for remote backups.
Restic
Cloud-friendly backup solution supporting multiple storage providers.
Recommended Backup Strategy
Daily:
- incremental backup
Weekly:
- full backup
Monthly:
- off-site backup
Organizations should periodically test restoration procedures to ensure backups are usable.
18. Docker Development Environment
Many development teams use Ubuntu as a host for Docker containers while sharing source code through Samba.
Example layout:
Ubuntu 24.04 │ ├── Docker Engine ├── Git ├── Samba ├── Joomla ├── WordPress ├── Magento └── AI Projects
Developers can edit files from Windows using Visual Studio Code while containers build and execute applications on Ubuntu.
Benefits include:
- centralized project storage
- consistent development environments
- simplified backups
- cross-platform collaboration
- efficient use of Linux tooling
19. Monitoring and Troubleshooting
View Active Sessions
sudo smbstatus
Validate Configuration
testparm
Restart Samba
sudo systemctl restart smbd
Review Logs
journalctl -u smbd
or
sudo tail -f /var/log/samba/log.smbd
Common Problems
|
Problem |
Solution |
|---|---|
|
Authentication failed |
Reset Samba password |
|
Permission denied |
Verify Linux ownership and group membership |
|
Share not visible |
Restart smbd and confirm browseable = yes |
|
Mount error 13 |
Check credentials and file permissions |
|
Mount error 95 |
Specify SMB version (e.g., vers=3.1.1) |
|
Slow transfers |
Verify Gigabit/2.5GbE connectivity and use NVMe storage |
20. Enterprise Use Cases
Software Development
Shared Git repositories, build artifacts, documentation, and CI/CD resources can be stored on a Samba server accessible by Windows and Linux developers.
Engineering Firms
Computer-Aided Design (CAD), simulation files, PCB layouts, and embedded software projects often require centralized storage with reliable access controls.
Educational Institutions
Computer laboratories can use Samba for student home directories, assignment distribution, and departmental collaboration.
Small and Medium-Sized Businesses (SMEs)
Departments such as accounting, sales, marketing, and operations can securely share documents without relying solely on public cloud storage.
AI and Data Science
Large datasets, trained models, notebooks, and experiment results can be stored on high-performance Ubuntu servers and accessed from multiple workstations.
How KeenComputer.com and IAS-Research.com Can Help
Organizations often require more than a basic file server. Professional planning, implementation, and support can ensure that Samba integrates effectively into broader IT and engineering environments.
KeenComputer.com can assist with:
- Ubuntu server deployment
- Samba installation and migration
- Windows-to-Linux file server migration
- Network design and optimization
- Docker-based development environments
- Website hosting infrastructure
- Backup and disaster recovery planning
- IT support for SMEs
IAS-Research.com can support:
- Engineering computing environments
- High-performance Linux systems
- AI and machine learning infrastructure
- Research data management
- Industrial IoT platforms
- Embedded Linux development
- System architecture consulting
- Technical training and documentation
Together, these services help organizations modernize their IT infrastructure while maintaining compatibility with existing Windows-based workflows.
Conclusion
Ubuntu 24.04 LTS and Samba provide a powerful, secure, and cost-effective alternative to proprietary file servers. By implementing SMB3, Linux permissions, authenticated access, firewall protection, and regular backups, organizations can create a robust file-sharing environment suitable for both small offices and enterprise deployments.
Throughout this tutorial, readers have learned how to install Samba, configure secure shared folders, integrate Windows and Ubuntu clients, automate mounts, harden security, optimize performance, and troubleshoot common issues. These practices establish a solid foundation for scalable file services that support software development, engineering collaboration, educational environments, and business operations.
As organizations continue to adopt Linux, containerization, hybrid cloud architectures, and AI-driven workflows, Samba remains an essential technology for cross-platform collaboration. When combined with Ubuntu 24.04 LTS, it delivers a stable, maintainable, and future-ready solution that can grow alongside organizational needs.
References
- Canonical. Ubuntu Server 24.04 LTS Documentation.
- The Samba Team. Using Samba (Official Documentation).
- Samba Team. Samba Administrator Guide.
- Linux Foundation. Linux System Administration.
- Microsoft. SMB Protocol Documentation.
- Red Hat. SELinux and Samba Administration.
- Ubuntu Community Documentation. Samba Server Guide.