Public Key Authentication from OpenSSH to SSH


I set up public key authentication from my machine to a couple of other machines. This is quite handy since you only need to provide your passphrase once and then the ssh agent does the authentication for you. However, I could not figure out why my key was not working with a particular server until I found out that there are differences between OpenSSH and SSH. To use your OpenSSH key with an SSH server, you need to convert it first and then put it in a specific place. Here a step by step tutorial, that I found here.

  1. Change to your local .ssh directory
    cd ~/.ssh
  2. Convert your public key
    ssh-keygen -e -f >
  3. Copy this new key to the remote machine into the .ssh2 directory
    scp ~/.ssh/ chris@remotemachine:~/.ssh2/
  4. SSH into the remote machine
    ssh chris@remotemachine
  5. Append information to the .ssh2/authorization file
    echo Key >> .ssh2/authorization

That’s it! From now one, “ssh remotemachine" will be enough.


Tags: , ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: