Mount a Windows/NAS Shared Folder with mount -t cifs
Attach an SMB network share to a local directory on Linux with cifs-utils so NAS or Windows files behave like local files.
Run sudo mount -t cifs //SERVER/share /mnt/nas -o username=youruser,uid=$(id -u) and enter the share password.
01Command
Command
$ sudo mount -t cifs //192.168.1.20/share /mnt/nas -o username=youruser,uid=$(id -u),iocharset=utf802What it does
The kernel's cifs filesystem client connects to any SMB share — a Windows PC, a Synology/QNAP NAS, or a Samba server — and presents it under the directory you choose. Setting uid=$(id -u) makes the mounted files owned by your user so you can read and write without sudo, and iocharset=utf8 keeps non-ASCII filenames intact. The mount disappears after reboot; add an entry to /etc/fstab (with credentials=filename,chmod=600) or a systemd automount to reconnect automatically.
03Risk
!Warning: Never put the share password directly in /etc/fstab in plain sight — use a credentials file owned by root with chmod 600; also make sure the mount point directory exists first.
04Undo
Undo
$ sudo umount /mnt/nas05Sources
- Samba — Arch WikiEvidence: Covers mounting SMB/CIFS shares on Linux with cifs-utils, mount options, and fstab credentials files.
- mount.cifs(8) — Ubuntu manual pageEvidence: Documents mounting SMB/CIFS shares via mount -t cifs, including username, uid, and iocharset options.
Last verified: 2026-09-18 · Category: Network