-
-
Notifications
You must be signed in to change notification settings - Fork 3
CachyOS File Sharing
Complete beginner-friendly guide to file sharing on CachyOS, including Samba (Windows file sharing), NFS, and network file sharing setup.
File sharing allows accessing files over network.
What it does:
- Network access: Access files from other computers
- Centralized storage: Share files from one location
- Cross-platform: Works with Windows, Linux, macOS
- Convenience: Easy file access
Why use file sharing:
- Network storage: Central file storage
- Backup: Network backups
- Collaboration: Share files with others
- Convenience: Access files from anywhere
Samba provides Windows-compatible file sharing.
What it does:
- Windows compatibility: Works with Windows
- SMB/CIFS protocol: Windows file sharing protocol
- Cross-platform: Linux, Windows, macOS
- Easy setup: Simple configuration
Install Samba:
sudo pacman -S sambaWhat this does:
- Installs Samba server
- Provides file sharing
- Makes sharing available
Start Samba:
sudo systemctl enable --now smb.service nmb.serviceWhat this does:
- Enables Samba at boot
- Starts Samba services
- Makes shares available
Edit Samba config:
sudo nano /etc/samba/smb.confAdd share:
[myshare]
path = /path/to/share
valid users = username
writable = yes
browseable = yes
What this means:
-
[myshare]: Share name -
path: Directory to share -
valid users: Allowed users -
writable: Allow writing -
browseable: Visible in network
Create Samba user:
sudo smbpasswd -a usernameWhat this does:
- Adds user to Samba
- Sets Samba password
- Required for access
Restart Samba:
sudo systemctl restart smb.service nmb.serviceWhat this does:
- Applies configuration
- Makes shares available
- Updates Samba
NFS (Network File System) is Linux file sharing.
What it does:
- Linux-native: Native Linux file sharing
- Fast: Good performance
- Unix-like: Works well on Linux/Unix
- Simple: Easy configuration
Install NFS:
sudo pacman -S nfs-utilsWhat this does:
- Installs NFS server
- Provides NFS sharing
- Makes sharing available
Start NFS:
sudo systemctl enable --now nfs-server.serviceWhat this does:
- Enables NFS at boot
- Starts NFS server
- Makes shares available
Edit exports:
sudo nano /etc/exportsAdd export:
/path/to/share 192.168.1.0/24(rw,sync,no_subtree_check)
What this means:
-
/path/to/share: Directory to share -
192.168.1.0/24: Allowed network -
rw: Read-write access -
sync: Synchronous writes
Export shares:
sudo exportfs -raWhat this does:
- Exports all shares
- Applies exports file
- Makes shares available
From file manager:
- Open file manager
- Go to "Network" or "Browse Network"
- Find Samba server
- Enter credentials
- Access shares
From command line:
smbclient //server/share -U usernameWhat this does:
- Connects to Samba share
- Prompts for password
- Access share
Mount Samba share:
sudo mount -t cifs //server/share /mnt -o username=userWhat this does:
- Mounts Samba share
- Makes accessible at /mnt
- Requires credentials
Mount NFS share:
sudo mount -t nfs server:/path/to/share /mntWhat this does:
- Mounts NFS share
- Makes accessible at /mnt
- Network file access
Permanent mount:
sudo nano /etc/fstabAdd:
server:/path/to/share /mnt nfs defaults 0 0
What this does:
- Mounts at boot
- Permanent access
- Auto-mounts
Check Samba status:
sudo systemctl status smbWhat this does:
- Shows Samba status
- Verifies it's running
- Helps troubleshoot
Check firewall:
sudo firewall-cmd --list-servicesWhat this does:
- Lists allowed services
- Samba may be blocked
- Allow Samba if needed
Allow Samba:
sudo firewall-cmd --add-service=samba --permanent
sudo firewall-cmd --reloadWhat this does:
- Allows Samba through firewall
- Makes shares accessible
- Fixes firewall issues
Check NFS status:
sudo systemctl status nfs-serverWhat this does:
- Shows NFS status
- Verifies it's running
- Helps troubleshoot
Check exports:
sudo exportfs -vWhat this does:
- Shows exported shares
- Verifies exports
- Helps troubleshoot
- CachyOS Network Configuration - Network setup
- CachyOS Security Configuration - Security settings
- Arch Linux Wiki - Samba: https://wiki.archlinux.org/title/Samba
- Arch Linux Wiki - NFS: https://wiki.archlinux.org/title/NFS
This guide covered:
- Understanding file sharing - What it is and why use it
- Samba setup - Windows-compatible file sharing
- NFS setup - Linux file sharing
- Accessing shares - How to access shared files
- Troubleshooting - Common file sharing issues
Key Takeaways:
- Samba for Windows compatibility
- NFS for Linux-native sharing
- Configure shares in config files
- Set up users and permissions
- Allow through firewall
- Mount shares for easy access
- Test connectivity if issues occur
This guide is based on the CachyOS Wiki and Arch Linux Wiki and expanded with detailed explanations for beginners. For the most up-to-date file sharing information, always refer to the official documentation.