Page:
Software Mount
Pages
Backups
Butterbian XFCE
Butterbian
Butterknife
Cloudflare Tunnel
Common Issues
Contact
Discourse
Docker Nextcloud
Docker Setup
Filebrowser
Filedrop
Forgejo
Glossary
Home
Homelab Jitsi
Homelab Plex
Homelab UPS
Host
Landing Sites
Links
Micro Editor
Migrate To Codeberg
My Setup
Nextcloud Drop
Nextcloud USB Drive
Nextcloud Users
Onboarding
Recovery
Resources
SFTP
Site Map
Software Geany
Software MKVToolNix
Software Mount
Software Razer
Software mise
Tailscale
Thoughts Codeberg
Thoughts Kernel
Thoughts ProtonMail
Thoughts Rolling Release
Transmission
No results
3
Software Mount
Drew edited this page 2026-05-01 21:02:06 -04:00
How to Mount SMB Shares
This guide shows how to mount SMB/CIFS network shares on Linux with proper permissions.
Method 1: basic mount
Create a mount point
sudo mkdir /mnt/myshare
Mount the share
sudo mount -t cifs //server-ip/share /mnt/myshare -o username=youruser,password=yourpass,uid=1000,gid=1000,file_mode=0664,dir_mode=0775
Test it works
touch /mnt/myshare/test.txt
mkdir /mnt/myshare/testfolder
Method 2: permanent mount (fstab)
Add to fstab for automatic mounting
sudo nano /etc/fstab
Add this line
/etc/fstab
//server-ip/share /mnt/myshare cifs username=youruser,password=yourpass,uid=1000,gid=1000,file_mode=0664,dir_mode=0775,_netdev,x-systemd.device-timeout=30,noauto,x-systemd.automount 0 0
Mount all fstab entries
sudo mount -a
Method 3: secure credentials
Create credentials file
sudo nano /etc/cifs-credentials
Add your login info
/etc/cifs-credentials
username=youruser
password=yourpass
Secure the file
sudo chmod 600 /etc/cifs-credentials
Use it in fstab
//server-ip/share /mnt/myshare cifs credentials=/etc/cifs-credentials,uid=1000,gid=1000,file_mode=0664,dir_mode=0775 0 0
Common options
file_mode=0664- Files are readable/writabledir_mode=0775- Folders are accessibleuid=1000- Your user ID (check withid -u)gid=1000- Your group ID (check withid -g)vers=3.0- SMB version (try 2.0 if 3.0 fails)
Important for file managers
When using file managers, navigate to your mount point (like /home/user/mount) instead of using smb:// URLs. This ensures applications can properly open files from the network share.
- Use:
/home/user/mount/file.txt - Avoid:
smb://server/share/file.txt
Unmount
sudo umount /mnt/myshare
Navigation
Quick Links
Projects
Server (discourse)
- Host
- Cloudflare Tunnel
- Tailscale
- SFTP
- Discourse
- Forgejo
- Filedrop
- Filebrowser
- Landing Sites
- Onboarding
- Backups
- Recovery
Window Managers
Homelab
Docker
Software
Thoughts
Archived
Connect
Butterbian — my Debian 13 distro · butterrepo — community APT repo · butterknife — TUI installer
justaguylinux.com · Butterforge · Butter Lab · The Churn · YouTube · Mastodon · Links · Contact · Support on Buy Me a Coffee
"Not an expert. Just A Guy." — Licensed CC BY-SA 4.0 · © 2026 JustAGuy Linux