[K12OSN] SSHFS and RSA keys
Bert Rolston
bert.rolston at clear.net.nz
Thu Sep 14 02:28:17 UTC 2006
Hi folks,
Thanks for your input.
I've got permissions sorted on the server so that Linux and Windows
clients behave the way I want.
I generated the rsa keys as per the following article
http://www.linuxjournal.com/article/8904
I've run the suggested test from the article to see if the keys work.
BUT WAIT, I still have to type in my password!?!?!?!?!?
Should I have entered a passphrase when creating the keys?
I've created the key on the server and copied the public to my machine
(/home/bert/.ssh/Authorized_keys). No joy.
I've created the key on my machine and copied the public key to my
server (/home/bert/.ssh/Authorized_keys), No joy.
I have a little script which I can run from the desktop which creates
the appropriate connections without any problem.
This isn't a biggy, but it would be nice to have it fully automated.
Any suggestions?
Thanks Bert
On Tue, 2006-09-05 at 08:32 -0500, Petre Scheie wrote:
> Bert Rolston wrote:
> > Hi folks,
> >
> > Thanks for the help with SMB4K, sshfs, and accessing file on my SAMBA
> > server from my Linux desktop.
> >
> > I've just about got it all working the way I want.
> >
> > I've gone with sshfs because it allows the file system access that I
> > want. Unfortunately I can't get it to force user ID's the way SAMBA
> > does. Which leads to my first question -
> >
> > "How do you force the user to be someone else when a file is created
> > while accessing files using sshfs, e.g. bert is the user that logs in
> > and accesses a file in public folder, but all files should remain
> > user=public, group=public?"
> >
> > My second question is how to automate the sshfs connection process, so
> > that it sort of simulates a login script, and automagically mounts the
> > server folders into my local file system? I've tried generating a
> > public/private key, but it isn't working.
> >
> You're on the right track: After you generate the public/private keys as bert, copy the
> public key to to user's ~/.ssh/authorized_keys file. Be sure the permissions on
> /home/user and /home/user/.ssh are set to 700 and /home/user/.ssh/authorized_keys are
> set to 600. Then, as user bert, you run the following:
>
> sshfs user at remotehost:/path/to/directory /home/bert/mountpoint
>
> Since you're attaching as user, all the files you create & modify on the remote host
> should be owned by user. As for the group permisssions, set the group sticky bit on the
> directory on the remote host.
>
> To 'automate' this, just put it in /etc/fstab. It will stay up all the time rather than
> being unmounted when the user logs out, but since it's just an ssh session, that
> shouldn't really be an issue (and it won't actually be doing anything when bert is not
> logged in). The syntax for the fstab file is like this:
>
> sshfs#USERNAME at REMOTE_HOST:REMOTE_PATH MOUNT_POINT fuse SSHFS_OPTIONS 0 0
>
> See the sshfs FAQ page for some examples at
> http://fuse.sourceforge.net/wiki/index.php/SshfsFaq
>
> HTH
>
> Petre
More information about the K12OSN
mailing list