Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
netmount sshfs
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
logistiker
n00b
n00b


Joined: 16 Jun 2008
Posts: 41

PostPosted: Wed May 19, 2010 4:33 pm    Post subject: netmount sshfs Reply with quote

Does anyone know if it's possible for netmount on openrc to automount password less sshfs mounts?

/etc/fstab example:

sshfs#user@host:/home/foo/bar /home/foo/bar fuse fsname=sshfs#user@host:/home/foo/bar,comment=sshfs,users,exec,uid=1000,gid=100,allow_other,reconnect,transform_symlinks,BatchMode=yes 0 0

I can mount this inside the user account but I can't mount it from root. I assume netmount runs as root as well and cannot mount this. This is the error I get when attempting to mount from root:

read: Connection reset by peer
Back to top
View user's profile Send private message
erik258
Advocate
Advocate


Joined: 12 Apr 2005
Posts: 2650
Location: Twin Cities, Minnesota, USA

PostPosted: Wed May 19, 2010 10:25 pm    Post subject: Reply with quote

I don't mean to be lame (I just cant help it) but can you please post relevant lines from fstab inside code tags? When it all runs together it's difficult to see what you're up to.

Since I've had a passing interest in sshfs for some time, I decided to install and play around.

The other thing I'm wondering is this: are you using an SSH key to connect? Because if you are, I'd imagine sshfs would be pulling it from ~/.ssh/id_rsa, which wouldn't be the same for root. But you'll have to bear with me while I familiarize myself with this sshfs thing...
_________________
Configuring a Firewall? Try my iptables configuration
LinuxCommando.com is my blog for linux-related scraps and tidbits. Stop by for a visit!
Back to top
View user's profile Send private message
logistiker
n00b
n00b


Joined: 16 Jun 2008
Posts: 41

PostPosted: Thu May 20, 2010 5:42 pm    Post subject: Reply with quote

Ok I figured it out

In /etc/fstab:

Code:
sshfs#user@host:/home/foo/bar /home/foo/bar fuse fsname=sshfs#user@host:/home/foo/bar,comment=sshfs,users,exec,uid=1000,gid=100,allow_other,reconnect,transform_symlinks,BatchMode=yes 0 0


In /root/.ssh:

Add your private key or keys for the machines you want to log into

And finally as the root user, log into those machines using the user for that machine (not necessarily root) so that the machine gets appended to the /root/.ssh/known_hosts file.


Then voila! netmount will mount sshfs.
Back to top
View user's profile Send private message
logistiker
n00b
n00b


Joined: 16 Jun 2008
Posts: 41

PostPosted: Thu May 20, 2010 5:47 pm    Post subject: Reply with quote

erik258 wrote:
Because if you are, I'd imagine sshfs would be pulling it from ~/.ssh/id_rsa, which wouldn't be the same for root.


Thanks for the hint. :)
Back to top
View user's profile Send private message
erik258
Advocate
Advocate


Joined: 12 Apr 2005
Posts: 2650
Location: Twin Cities, Minnesota, USA

PostPosted: Fri May 21, 2010 3:19 am    Post subject: Reply with quote

Woot.

hey, this sshfs stuff is awesome! A bit slow, but that's to be expected. Totally awesome. No longer must I fiddle with scp commands to access a bunch of files over ssh, and that makes me happy. so thanks for spurring me to investigate.
_________________
Configuring a Firewall? Try my iptables configuration
LinuxCommando.com is my blog for linux-related scraps and tidbits. Stop by for a visit!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum