Practical steps to attach Windows-style shares to your Linux filesystem from the shell. 15.01.2026 | reading time: 3 min Want direct access to a Windows or NAS share from the shell? Learn the exact commands to mount an SMB/CIFS share with mount.cifs, handle credentials securely, and control ownership and permissions so files behave like local data. Hands-on Example Follow these commands and their expected output to mount a remote SMB share quickly: ```bash sudo apt update && sudo apt install -y cifs-utils sudo mkdir -p /mnt/shared printf "username=alice password=Secret123 " | sudo tee /root/.smbcredentials > /dev/null sudo chmod 600 /root/.smbcredentials sudo mount -t cifs //192.168.1.10/shared /mnt/shared -o credentials=/root/.smbcredentials,uid=1000,gid=1000,dir_mode=0755,file_mode=0644,vers=3.0 # verify mount | grep /mnt/shared ls -l /mnt/shared ```Expected terminal output after verification might look like: ```text //192.168.1.10/shared on /mnt/shared type cifs (rw,relatime,vers=3.0,sec=ntlmssp,...) total 8 drwxr-xr-x 2 root root 4096 Jan 12 12:00 docs -rw-r--r-- 1 root root 12 Jan 12 12:00 readme.txt ``` Key Options to Use Use a credentials file to avoid passwords on the command line; set uid and gid to map ownership; set file_mode and dir_mode to control permissions; and force an SMB version with vers=3.0 if the server rejects negotiation. If you need domain authentication add domain=MYDOMAIN or use sec=ntlmssp; guest connects with the guest option; and nounix disables POSIX extension mapping when permissions look wrong. Automount and fstab Tricks For persistent mounts add a safe fstab entry and prefer a credentials file instead of plaintext passwords; a practical fstab line is: ```//192.168.1.10/shared /mnt/shared cifs credentials=/root/.smbcredentials,uid=1000,gid=1000,vers=3.0,x-systemd.automount 0 0``` which lets systemd activate the mount on first access and avoids slow boot hangs. Tools Around SMB When mount.cifs is the direct way to attach a share, other tools help: use smbclient as an FTP-like tester to list shares and transfer single files; use smbd and nmbd when serving SMB from Linux; and desktop stacks like GVfs or KDE's KIO provide user-friendly mounting for graphical sessions. Clear Finish You now know how to attach SMB shares manually, secure credentials, set ownership, and make mounts persistent with systemd; practice these steps on a test share and troubleshoot with kernel logs if needed. Expand this hands-on skill into broader Linux competence and consider exam-focused training such as CompTIA Linux+ or LPIC-1 with intensive preparation at bitsandbytes.academy to formalize the knowledge. Join Bits & Bytes Academy First class LINUX exam preparation. setup filesystem utilities network storage