Step-by-Step Guide to Setup NFS and Samba on Linux (Beginner Friendly)
📌 Introduction:
Sharing files across a network is a common task in Linux system administration. Two popular methods are NFS (Network File System) and Samba (SMB/CIFS).
In this guide, you’ll learn how to set up both NFS and Samba step-by-step, so you can enable file sharing between Linux and Windows systems.
🔧 Part 1: Setting Up NFS (Linux-to-Linux File Sharing)
✅ 1. Install NFS Packages
On both server and client:
✅ 2. Create Shared Directory on NFS Server
✅ 3. Configure NFS Exports
Edit the exports file:
Add:
Then apply the export:
✅ 4. Start and Enable NFS Services
✅ 5. Allow Firewall (RHEL-based systems)
✅ 6. Mount from NFS Client
On client machine:
Make it permanent:
💡 NFS Use Cases
-
Best for Linux-to-Linux file sharing
-
Lightweight and fast for internal networks
🧰 Part 2: Setting Up Samba (Linux-to-Windows File Sharing)
✅ 1. Install Samba
✅ 2. Create Shared Folder
✅ 3. Edit Samba Configuration
Open:
Add at the end:
✅ 4. Restart Samba Service
✅ 5. Access From Windows
-
Open File Explorer
-
Type in address bar:
\\192.168.1.10\sambashare
✅ Now you can copy/paste files between Linux and Windows!
🔒 Optional: Secure Samba with a Username
Update smb.conf to require login:
📦 Useful Accessories [Amazon Affiliate Links]
🔗 You can add these to your blog post to earn commissions:
📌 Conclusion
Both NFS and Samba are powerful file-sharing protocols.
-
Use NFS when working Linux-to-Linux
-
Use Samba for Linux-to-Windows or cross-platform sharing
Experiment with both to understand how Linux file sharing works in real time.
Have questions or want to see video tutorials? Let me know in the comments!
✅ Disclosure: Some links in this post are affiliate links. If you purchase through them, I may earn a small commission at no extra cost to you.
Comments
Post a Comment