π§ Samba (SMB) Setup Guide β MiniPC β Main PC
This guide explains how to share folders between two computers using Samba (SMB) β ideal for Linux β Windows interoperability.
βοΈ 1. Install Samba on the MiniPC (server)
| |
π 2. Create a shared folder
| |
(Replace youruser with your actual username β same UID 1000 on both PCs.)
π§Ύ 3. Configure Samba
Edit the configuration file:
| |
Append this section at the end:
[shared]
path = /srv/samba/share
browseable = yes
read only = no
guest ok = no
create mask = 0664
directory mask = 0775
valid users = youruser
Save and exit (Ctrl + O, Enter, Ctrl + X).
π 4. Add your user to Samba
| |
π₯ 5. Allow Samba through the firewall (LAN only)
| |
π§© 6. Connect from your Main PC
π₯οΈ If main PC is Linux
Install CIFS utilities:
| |
Mount the share:
| |
Unmount:
| |
Make persistent (optional) by adding to /etc/fstab:
# Format: //<server>/<share> <mountpoint> cifs <options>
//192.168.1.50/shared /mnt/minipc-smb cifs username=youruser,password=YOURPASSWORD,uid=1000,gid=1000,_netdev 0 0
πͺ If main PC is Windows
- Open File Explorer and type in the address bar:
\\192.168.1.50\shared - Enter your Samba username/password.
- (Optional) Right-click β βMap Network Driveβ¦β to make it permanent.
π§ͺ 7. Test your setup
On MiniPC:
| |
On main PC:
| |
Or create a new file in File Explorer if on Windows.
π οΈ Troubleshooting
| Issue | Cause | Fix |
|---|---|---|
| Permission denied | Ownership mismatch | sudo chown -R youruser /srv/samba/share |
| Network path not found | Wrong IP or firewall | Check IP, sudo ufw status, restart Samba |
| Slow transfers | Protocol mismatch | Add mount option vers=3.0 |
| Windows login fails | Wrong domain syntax | Try .\youruser as username |
| Guest access fails | Guest disabled | Enable guest ok = yes (not recommended) |
π Security Tips
- Disable guest access unless absolutely necessary.
- Restrict subnet access with UFW.
- Use per-user credentials.
- Do not expose ports 445 or 139 to the Internet.
βοΈ Bonus β Connect via GUI (GNOME/KDE)
In your file manager:
Other Locations β Connect to Server β smb://192.168.1.50/shared
Bookmark it for quick access.
Last updated: 2025-11-01