Turns out that I need to add a local (client) UID to the mount line in FSTAB to make this work. I arrived at this via sheer brute force:

//192.168.0.5/storage /media/myname/TK-Public/ cifs guest,uid=myuser,iocharset=utf8,file_mode=0777,dir_mode=0777,noperm 0 0
Answer from Kendor on askubuntu.com
🌐
Reddit
reddit.com › r/linuxquestions › trying to mount cifs shares via fstab
r/linuxquestions on Reddit: Trying to mount CIFS shares via fstab
August 15, 2019 -

Hi everyone. Got a feeling I'm missing something super simple, but can't work it out myself. I can mount my CIFS share via sudo mount.cifs commands, but not withut sudo, nor via fstab. The share is only being mounted for myself on the desktop - no other users, hence why it's mounting within my home folder..

Followed MountCifsFstab, and I'm running Ubuntu Mate 20.4 LTS. Server is running Xubuntu 20.04 LTS.

This works in terminal, but the mount is in root, and read-only for non-root users.

sudo mount.cifs -o username=user,password=pass //192.168.1.102/torrents /home/desktop/mounts/torrents

These commands don't work, even though it's setup in /etc/fstab:

mount.cifs -o username=user,password=pass //192.168.1.102/torrents /home/desktop/mounts/torrents

mount /home/desktop/mounts/torrents

sudo mount /home/desktop/mounts/torrents

In all of these cases (same command without sudo, or trying to mount with/without sudo from fstab), the error returned is mount error(2): No such file or directory. Obviously, the file/directory does exist and the credentials are fine, because the first command works.

Extract of my /etc/fstab (all other lines in my fstab are for local disks, and none of them refer to :

# <file system>         <mount point>                   <type>  <options>           <dump>  <pass>
//192.168.1.2/torrents	/home/desktop/mounts/torrents	cifs	noperm,user,username=user,password=pass	0	0

So what is my fstab missing that prevents me from using fstab to mount (preferably without sudo)? Thanks in advance.

🌐
Ubuntu
help.ubuntu.com › community › MountCifsFstab
MountCifsFstab - Community Help Wiki
If you want to have persistent mounts, so that the mounts get mounted automatically at boot time, you can use the fstab file. ... If the windows machine has the “Turn OFF password protected sharing” option set, and you want all Linux users to have read/write permissions to the share, add this line to the bottom of the fstab file: //win10/share1 /mnt/share1 cifs noperm,_netdev 0 0
🌐
Linux Mint Forums
forums.linuxmint.com › board index › main edition support › networking
Add connection options to CIFS in /etc/fstab [SOLVED] - Linux Mint Forums
However, I'd like to add several options I previously set when manually connecting using the mount.cifs -o command. Using that command it is possible to add comma-separated options after -o like seal to encrypt the connection or cache=none to disable caching. You would just add it to the fstab declaration the same way:
🌐
Ubuntu
ubuntu.com › server › docs › how-to-mount-cifs-shares-permanently
How to mount CIFS shares permanently | Ubuntu
uid=1000 makes the Linux user (specified by the ID) the owner of the mounted share, allowing them to rename files, and · If there is any space in the server path, you need to replace it by \040, for example: //servername/My\040Documents ... To auto-mount a password-protected share, you can edit /etc/fstab (with root privileges), and add this line: //servername/sharename /media/windowsshare cifs username=msusername,password=mspassword 0 0
🌐
Linuxize
linuxize.com › post › how-to-mount-cifs-windows-share-on-linux
How to Mount Windows Share on Linux using CIFS | Linuxize
November 23, 2019 - To automatically mount a Windows share when your Linux system starts up, define the mount in the /etc/fstab file. The line must include the hostname or the IP address of the Windows PC, the share name, and the mount point on the local machine.
Find elsewhere
🌐
Ubuntu
documentation.ubuntu.com › server › how-to › samba › mount-cifs-shares-permanently
How to mount CIFS shares permanently - Ubuntu Server documentation
December 11, 2025 - uid=1000 makes the Linux user (specified by the ID) the owner of the mounted share, allowing them to rename files, and · If there is any space in the server path, you need to replace it by \040, for example: //servername/My\040Documents ... To auto-mount a password-protected share, you can edit /etc/fstab (with root privileges), and add this line: //servername/sharename /media/windowsshare cifs username=msusername,password=mspassword 0 0
🌐
Linux Man Pages
linux.die.net › man › 8 › mount.cifs
mount.cifs(8) - Linux man page
This is preferred over having passwords in plaintext in a shared file, such as /etc/fstab. Be sure to protect any credentials file properly. ... sets the uid that will own all files or directories on the mounted filesystem when the server does not provide ownership information. It may be specified as either a username or a numeric uid. When not specified, the default is uid 0. The mount.cifs helper must be at version 1.10 or higher to support specifying the uid in non-numeric form.
🌐
Ubuntu Wiki
wiki.ubuntu.com › MountWindowsSharesPermanently
MountWindowsSharesPermanently - Ubuntu Wiki
Then edit your /etc/fstab file (with root privileges) to add this line (replacing the insecure line in the example above, if you added it): //servername/sharename /media/windowsshare cifs credentials=/home/ubuntuusername/.smbcredentials,iocharset=utf8 0 0 · Save the file, exit the editor. ... If there are no errors, you should test how it works after a reboot. Your remote share should mount automatically.
🌐
Raspberry Pi Forums
forums.raspberrypi.com › board index › projects › networking and servers
mount a cifs share using fstab - Raspberry Pi Forums
If you set "Wait for Network on Boot" in raspi-config to "Yes" and add a suitable fstab entry as I suggested above including "_netdev" it should work, it does on several of my linux boxes (yeah, yeah, I know). "_netdev" tells systemd to schedule the mount after network is up.
🌐
Rocky Linux Forum
forums.rockylinux.org › rocky linux help & support
Fstab and CIFS help - Rocky Linux Help & Support - Rocky Linux Forum
May 27, 2023 - I’m looking at how to use /etc/fstab to mount a file share at a certain mount point. There is an example fstab file on wikipedia: device-spec mount-point fs-type options dump pass LABEL=/ / ext4 defaults 1 1 /dev/sda6 none swap defaults 0 0 none /dev/pts devpts gid=5,mode=620 ...
🌐
Linux Mint Forums
forums.linuxmint.com › board index › main edition support › networking
[Solved] Setting up a SAMBA share in /etc/fstab to auto mount automatically - Linux Mint Forums
First only root can mount anything unless it's told otherwise. Example: First, unmount the share if it is in fact mounted: ... //10.0.0.5/share /media/nc/sharemount cifs guest,iocharsetutf8,noperm,noauto,user 0 0 Maybe have to add the ,vers=1.0 option. You don't have to do anything else but save fstab.
🌐
Linux Mint Forums
forums.linuxmint.com › board index › main edition support › networking
fstab auto mounting smb/cifs on boot while securing your client machine. thanks to home encryption. - Linux Mint Forums
for example /home/bob/.credentials/smb/nas nas is a text file that has no extension. you can have a .txt or whatever extension you want. open terminal and type sudo xed /etc/fstab this will open fstab in edit mode. edit it as per https://help.ubuntu.com/community/Fstab in the options make sure ...
🌐
Red Hat
access.redhat.com › solutions › 448263
How to mount Windows share on Red Hat Enterprise Linux system using CIFS? - Red Hat Customer Portal
By default, Windows shares are mounted with the full permission (0755) in Linux. To change the default permission use the dir_mode and file_mode options to set directory and file permission. # mount -t cifs -o username=<share user>,password=<sharepassword>,dir_mode=0755,file_mode=0755 //WIN_PC_IP/<share name> /mnt · To make the mount persistent across reboots, make the below entry to the /etc/fstab
🌐
TrueNAS Community
truenas.com › forums › archives › freenas (legacy software releases) › freenas help & support › sharing
Mounting CIFS w/ SMB3 to fstab | TrueNAS Community
December 5, 2017 - I noticed that the default mounting only worked when I set the minimum share level to LANMAN but hours later I was able to mount SMB2/3 by adding the "vers=3.0" argument. Example: FreeNAS Username = "user3" (UID=1003 | GID =1003&1000) Linux Username = "user3" (UID 1000 | GID 1000) //<server>/Uploads /mnt/Uploads cifs credentials=/etc/secrets,vers=3.0,uid=1000,gid=1000,file_mode=0770,dir_mode=0770 0 0 1. What do you use in your /etc/fstab for mounting CIFS shares?