I have used sshfs on my Linux Mint machine to mount a directory from a different machine in the internet. This worked out of the box.
Then I tried the exact same command on a Ubuntu machine (Ubuntu 22.04.3 LTS) and got this error:
~$ sshfs -v <some machine on the interwebs> ~/fusessh/
fusermount3: mount failed: Permission denied
These are the permissions in my home directory on the Ubuntu machine:
drwx------ 27 my_user group_a 4096 Sep 15 14:36 .
drwx------ 2 my_user group_b 4096 Aug 23 13:06 Desktop
drwx------ 2 my_user group_b 4096 Aug 23 13:06 Documents
drwx------ 2 my_user group_b 4096 Aug 23 13:06 Downloads
drwx------ 2 my_user group_b 4096 Sep 12 14:04 fusessh
my_user is in both group_a and group_b.
~$ groups thsi
my_user : group_b sudo group_a
Edit based on the comments:
~$ ls -l /bin/fusermount3
-rwsr-xr-x 1 root root 35200 Mar 23 2022 /bin/fusermount3
In sandbox mode:
~$ unshare --map-root-user
~# ls -l /bin/fusermount3
-rwsr-xr-x 1 nobody nogroup 35200 Mar 23 2022 /bin/fusermount3
sudo
, but you could create a userspace mapping your user toroot
withunshare --map-root
then try yoursshfs ...
command again from the new userspace and see if it works. – Raffa Sep 15 '23 at 13:26unshare --map-root-user
withoutsudo
... That is called user namespace/sandboxing and it's even safer than using your own user in the plain especially with Internet mounts ... Please see How do I use the user namespace sandbox? – Raffa Sep 15 '23 at 13:40fusermount3: mount failed: Operation not permitted
– Simon T. Sep 15 '23 at 13:45ls -l /bin/fusermount3
– Raffa Sep 15 '23 at 14:50-rwsr-xr-x 1 nobody nogroup 35200 Mar 23 2022 /bin/fusermount3
– Simon T. Sep 19 '23 at 09:13ls -l /bin/fusermount3
from within a user namespace/sandbox or under your normal user ... If the former, then please open a new terminal and run the command again and show the output ... If the latter, then the ownership is not correct and you need to correct it withsudo chown root:root /bin/fusermount3
then runsudo chmod u+s /bin/fusermount3
– Raffa Sep 19 '23 at 09:28fusermount3: mount failed: Permission denied
except for the lack of group and especially others permissions on the mount point ... So, trychmod 0775 ~/fusessh/
and see if that works. – Raffa Sep 19 '23 at 09:45chmod 0777 ~/fusessh/
on the mount point while the filesystem is unmounted although I can't see how that would apply the mount itself ... If that didn't work, then you might want to mount the filesystem and check the permission while mounted. – Raffa Sep 19 '23 at 11:15