Setting up SSH keys

Sometimes you work with your remote host so much, that having to enter a password every time becomes a real pain. If that is the case, you should follow with this instructions to set up automatic handshake with your remote host.

First off, you have to have OpenSSH on both the host and your local machine. SSH into your remote host to create the .ssh” directory in your home folder.

Now we are going to use the SSH Key Generator to create the authorized key.

You will be prompted to enter a passphrase for this identity key. Choose something hard to break.

Now all you have to do is copy the identity key to the remote host.

Of course, you will replace myuser@remove.host.com” with your actual remote host’s access information. Now, you will run a simple script that will tell the remote host which identity it should use, and also starts a new shell that will enable you to SSH to the remote host without entering any passwords.

Now try typing “ssh myuser@remote.host.com” and you will see that you are all set.

2 thoughts on “Setting up SSH keys

  1. Jeff Harver says:

    Instead of the scp line, consider using ssh-copy-id. Also, I think most people use:

    eval ssh-agent in their .Xsession or a similarly placed script for their X environment so as to share a common ssh-agent.

    • Milad Naseri says:

      Hmmm, cool. Well, at the time of writing this I wasn’t aware of the ssh-copy-id. But I ended up knowing about it eventually.

      Thanks for the comment, though. Much appreciated.

Leave a Reply

Your email address will not be published. Required fields are marked *