I used sshfs without sudo to create a directory like
sshfs [email protected]:/media/user/harddrive /temp/user/harddrive
but when I want to umount the /temp/user/harddrive
directory with
umount /temp/user/harddrive
it prompts:
umount: /temp/user/harddrive: Permission denied
so how to umount this directory?
sshfs
uses FUSE (File system in USErspace) instead of the regularmount
with elevated permissions.That also means you can not use
umount
(the counterpart ofmount
) to unmount the file system though, but you havefusermount -u
, the FUSE unmount command:For more info, see e.g.
man sshfs
andman fusermount
.This answer refers to Ubuntu 20.04, but in general you need two steps to properly unmount a
sshfs
volume: i) kill thesshfs
process and ii) usesudo
to unmount. Without usingsudo
, the system reports messages like "Device or resource busy" or "Transport endpoint is not connected", even if permissions are correct.The instructions look like: