You are not logged in.

#1 2009-08-14 16:17:41

jacko
Member
Registered: 2007-11-23
Posts: 840

mounting sshfs shares on boot fails

I have figured this out, but I am not exactly sure if my solution is the best solution or if there is a bug here or even another way to solve this.

I have an entry in my fstab that looks like this

sshfs#jasin@192.168.1.3:torrents/ /mnt/desktop/ fuse defaults,users,port=22000,allow_other 0  0

pretty straight forward according to the wiki here. http://wiki.archlinux.org/index.php/Sshfs#Fstab

My issue was, that at boot time running netfs would fail because root was trying to access my desktop pc as USER root and NOT USER jasin which is what the authorized_key was for, USER jasin.

I fixed the issue by generating a key for USER root and adding that to my desktops .ssh/authorized_keys file.

Was this the right solution? Is there another way to go about fixing this issue without needing a rsa key for USER root? Is the wiki just unclear and should be updated with the proper information? I will fix the wiki, but I don't want to change something that I do not fully understand. Any help would be appreciated.

Offline

#2 2009-08-14 17:59:50

djszapi
Member
From: Cambridge, United Kingdom
Registered: 2009-06-14
Posts: 1,439
Website

Re: mounting sshfs shares on boot fails

"Although the above will not work automatically unless you are using a ssh key for the user. "

I think your solution is okay, but maybe I'm wrong.

Offline

#3 2009-08-15 10:30:07

hbekel
Member
Registered: 2008-10-04
Posts: 311

Re: mounting sshfs shares on boot fails

Instead of mounting your share using /etc/rc.d/netfs in combination with fstab you might just explicitly mount your share from rc.local using your 'jasin' user:

su jasin -c 'your mount command'

You might also need the -l option to su to make the command run in a proper login shell for user jasin. Not sure if that's required for sshfs mounts, but it may be.

I'd say this is the cleaner approach because it doesn't require any special setup on the machine you mount the share from and avoids to mount it as root, which I'd at least feel uneasy about.

Offline

Board footer

Powered by FluxBB