Mounting a webDAV share for all users
Your running login session might not be updated with the new group yet. Try just calling groups
and see if that lists davfs2.
$ sudo useradd foo -M
$ groups
myuser adm cdrom sudo dip plugdev lpadmin sambashare
$ sudo usermod -aG foo myuser
$ groups
myuser adm cdrom sudo dip plugdev lpadmin sambashare
$ su -l myuser
$ groups
myuser myuser adm cdrom sudo dip plugdev lpadmin sambashare foo
Related videos on Youtube
Minos
Updated on September 18, 2022Comments
-
Minos over 1 year
I'm trying to mount a webDAV share with this fstab line:
myserverip /media/myserver/ davfs noauto,user,rw 0 0
I have added the secret credentials to
~/.davfs2/secrets
.Also done
sudo dpkg-reconfigure davfs2
to allow mounting by non-root users.This all works fine if I have the following in
/etc/davfs2/davfs2.conf
:dav_user myusername # system wide config file only dav_group myusername # system wide config file only
But this obviously only works for one user, however if I leave it at the default:
dav_user davfs2 # system wide config file only dav_group davfs2 # system wide config file only
and add my user account to the group davfs2 via
sudo usermod -aG davfs2 myusername
which is successful as shown by the output of
groups myusername
:myusername : myusername davfs2
However when I now try to mount the share I get the following error:
/sbin/mount.davfs: user myusername must be a member of group davfs2
So how do I get it to mount by group and why does it not recognize that I’m in the correct group.
-
Minos almost 10 yearsYep, noticed my mistake just now... got myself locked out of the sudo, can probably restore that, but is there anyway I can find out what user groups I'm supposed to be part of?
-
Minos almost 10 yearsalso mounting works just fine after a reboot.
-
noleti almost 10 yearsMaybe create new user and check the groups that he gets put in? also, sudo, of course.
-
BTR Naidu over 7 yearsLogout and login helped.
-
noleti over 7 yearsI realize I never explicitly suggested a solution:
su -l myuser
will also update your current login session