0

How do I mount network shares without root? It has been discussed a lot but I found no useful answers (sudo not acceptable, fstabs not acceptable, mount.cifs does not work without root either).

The issue is, Dolphin (KDE file manager) or Krusader can mount e.g. USB drives without requiring me to be a root as described here. But it cannot be used for network shares. Is there any similar approach for smb shares?

atapaka
  • 541

2 Answers2

1

You can use gvfs-mount:

gvfs-mount smb://user@server/storage

Depending on the version and OS, you can then find the mounted storage below ~/.gvfs or /run/user/$UID/gvfs


Related:

pLumo
  • 22,565
0

Well, you can get /etc/fstab mounts to work without sudo, but then you will have problems with the username.

I can have a

//<some-server>/data$/smbshares/Cluster /mnt/Dfs/Cluster cifs user,vers=3.0,sec=ntlmv2,uid=1000,gid=1000,iocharset=utf8,nounix,noauto,_netdev 0 0

entry in fstab, and I can then do a user mount as

mount -v -v /mnt/Dfs/Cluster/

and it will also ask for a password when mounting

Password for myuser@//<some-server>/data$/smbshares/Cluster:

But it will now mount the SMB remote with my login username.  Now, my username and the username for the SMB may not be equal, and here is the main problem: I could specify a -o option for the user mount as

mount -v -v /mnt/Dfs/Cluster/ -o user=mysambauser1231

but it seems this local user=name clashes with the needed user options in the fstab entry.  Trying different modes of the --options-mode

mount /mnt/Dfs/Cluster/ -o user=au204573 --options-mode append

did not work for me (I tried append, prepend, and replace).  So I am not able to mount as a user with an SMB username different than the current username.

(But hardcoding the SMB username in the fstab works, à la user,user=mysambauser1231,vers=3.0,sec=ntlmv2,..!)

Cef
  • 1