Linux Samba Guide - ryzendew/Linux-Tips-and-Tricks GitHub Wiki
Linux Samba Guide
Complete beginner-friendly guide to Samba on Linux, covering Arch Linux, CachyOS, and other distributions including installation, file sharing, and Windows compatibility.
Table of Contents
Samba Installation
Install Samba
Arch/CachyOS:
# Install Samba
sudo pacman -S samba
# Enable service
sudo systemctl enable --now smb nmb
Debian/Ubuntu:
sudo apt install samba
sudo systemctl enable smbd nmbd
Fedora:
sudo dnf install samba
sudo systemctl enable smb nmb
Verify Installation
Check Samba:
# Check service
systemctl status smb
# Check version
smbclient --version
Samba Configuration
Edit Config
Configure Samba:
# Edit config
sudo vim /etc/samba/smb.conf
Basic Settings
Common settings:
[global]
workgroup = WORKGROUP
server string = Samba Server
security = user
[share]
path = /srv/samba/share
browsable = yes
writable = yes
valid users = username
Share Directories
Create Share
Add share:
# Edit smb.conf
sudo vim /etc/samba/smb.conf
Add:
[myshare]
path = /home/user/share
browsable = yes
writable = yes
valid users = user
Set Permissions
Configure permissions:
# Set directory permissions
chmod 755 /home/user/share
# Set ownership
chown user:user /home/user/share
Access Shares
Create Samba User
Add user:
# Create Samba user
sudo smbpasswd -a username
# Enable user
sudo smbpasswd -e username
Access from Windows
Windows access:
- Open File Explorer
- Address bar:
\\server-ip\share - Enter username/password
- Access files
Troubleshooting
Samba Not Working
Check service:
# Check status
systemctl status smb
# Check logs
journalctl -u smb
# Test config
testparm
Permission Issues
Fix permissions:
# Check directory permissions
ls -la /path/to/share
# Set correct permissions
chmod 755 /path/to/share
chown user:user /path/to/share
Summary
This guide covered Samba installation, configuration, and file sharing for Arch Linux, CachyOS, and other distributions.
Next Steps
- File Sharing - File sharing setup
- Networking - Network setup
- Samba: https://www.samba.org/
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.