Ubuntu – Can’t Mount SSHFS via FSTAB, but can mount via CLI. How to get FSTAB to mount properly

fstabfusesshfs

I have setup password less SSH access and it works properly. I'm unable to automatically mount my SSHFS.

This works:

sshfs root@192.168.0.2:/vmfs/volumes/ESATA01/ ~/VPS

However, when inserted into my FSTAB, my logged in user get this

sshfs#root@192.168.0.2:/vmfs/volumes/ESATA01/   /home/amahi/VPS      fuse defaults,idmap=user 0 0

enter image description here

I definitely have a permissions issue as here related to where the mount point is. It seems that when I do the raw fuse mount from the CLI, I'm doing it as the non-sudo logged in user. If I mount from fstab, it's being done as sudo.

If I run nautilus as sudo, I'm able to get to the contents of the SSHFS.

Any input is appreciated.

Best Answer

Perhaps a more elegant way to do this would be to tell mount that:

  • this mountpoint is a network device (so it can check it)
  • this mountpoint shouldn't be automounted, but rather on-demand

Example:

me@svr:/movies  /MOUNTPOINT  fuse.sshfs noauto,x-systemd.automount,_netdev 0 0

From https://wiki.archlinux.org/index.php/Sshfs

Related Question