Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question
    
Try the option allow_other, like: defaults,idmap=user,allow_other. –  Eric Carvalho Jun 17 '13 at 18:16
    
Thanks @EricCarvalho. That worked. I was banging my head against the wall for several hours... –  Kendor Jun 17 '13 at 18:34
add comment

2 Answers

Per Eric's reply, I needed to add "allow_other" into my FSTAB entry. Once I did that, I was able to mount properly; however, It didn't work properly on reboot.

I discovered that because of the timing of the network coming up, I needed create a delay mechanism. I also needed to add the _netdev paramater to the end of my FSTAB entry.

I found the following here

If the automatic mounting procedure following a reboot is not successful, it may be because the drive is not yet ready when executing “fstab”.  To remedy this, please just enter the following lines in the file “/etc/rc.local” in front of the line “exit 0”:

sleep 20
mount -a

You can progressively reduce the value 20 until it is just sufficient to mount your Drive successfully after a reboot.
share|improve this answer
add comment

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

Been using ubuntu since 7 years now. The more I compare it with my new Arch linux installation the more I realise how many "hacked" and hillbilly "solutions" we have in the ubuntu community... this is one example! Seriously, using 'sleep' to delay a mount?! wtf.

share|improve this answer
    
This solution is also great because you won't need another hacked "solution" for system-shutdown (for example you don't need to create a script that will unmount your sshfs when rebooting, etc) –  user204027 Oct 18 '13 at 9:11
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.