Ubuntu – Mounting CIFS as user in Ubuntu 16.04 returns “No such file or directory”


I recently upgraded from (X)ubuntu 14.04 to 16.04 (meaning a complete new installation, nothing left on hard drive). For the past years, I had the following line in my /etc/fstab:

//home.server/Development /home/user/development  cifs noauto,user,credentials=/home/user/.smbcredentials,uid=1000,gid=1000,dir_mode=0555,file_mode=0644  0 0

And I could mount it manually, no problem.

Since 16.04. however, when trying to mount the CIFS target with normal user rights, I get the following error:

 user:~$ mount //some.server/Development
 mount: //some.server/Development: No such file or directory

 user:~$ mount "//some.server/Development"
 mount: //some.server/Development: No such file or directory

However, if I repeat the command with sudo everything works and the CIFS target is mounted.

What I've tried so far:

  • I checked man fstab and man mount, but their description of the user option hasn't changed
  • I checked that /sbin/mount.cifs has the SUID flag set
  • I removed one by one all options from the line, to check whether one was creating the problem
  • I moved .smbcredentials to an unencrypted partition
  • I changed user option to the less save users option
  • mount.cifs version is 6.4

None of the above has improved the situation.
And I don't want to automount the CIFS as it would request to store the .smbcredentials file in an unencrypted partition. Additionally, I would have to make some workarounds to assure the network is up before mounting.

Has anyone an idea what else I may try?

Best Answer

  • This may not be possible any longer by default on Xubuntu 16.04 -- There is a note on the MountWindowsSharesPermanently Ubuntu Help Wiki that offers a workaround though:

    Note: Regretfully as from version 3.3.2-1ubuntu3.2 (October 2009) this approach is no longer possible together with the "user" option. A security fix prevents reading the credentials file if you don't have read access to it. You will have to pin the packages at version 3.3.2-1ubuntu3 or 3.3.2-1ubuntu3.1 to continue using this approach as non-root.

  • Related Question