3

I want to be able to automount an ubuntu volume on my mac using sshfs. I tried using ssh key-gen and copying the id_rsa file, adding the pub key to my authorized keys, using all sorts of sshfs -o options, to no avail.

Joe Hanink
  • 4,767
  • 4
  • 19
  • 21
  • 1
    You might want to be more explicit regarding the steps you've taken if you want detailed help. Otherwise I can only suggest you retrace your steps and make sure you didn't miss anything (like setting proper permissions on your authorized_keys file on the remote and ensuring that it is enabled in `/etc/ssh/sshd_config`). – coreyward Feb 19 '11 at 05:58
  • I retraced my steps. I had done the keygen and key transfer in the wrong direction. it's working now. thanks. – Joe Hanink Feb 19 '11 at 09:46

1 Answers1

0

The procedure for setting up ssh key authentication is the same whether you are using it for sshfs or something else.

On the client side you generate a key. In this case we are making a DSA key

ssh-keygen -t dsa

You should now have an id_dsa file and an id_dsa.pub file in your .ssh directory. The pub file is your public key, and its contents get placed inside the authorized_keys file (or authorized_keys2 if you are using a DSA key as above) in the .ssh directory of the server to which you want to log in.

If you are on a Linux client, you can probably push the key to the server using the ssh-copy-id command.

ssh-copy-id user@server:

On the client side the id_dsa file needs to be owned by you and have 600 permissions, which is the default when you generate the key. On the server side the authorized_keys file needs to be owned by you and not be world writable, which should be the case if you don't do anything weird when copying it over like doing that as root.

Joshua Jackson
  • 136
  • 1
  • 3