Published on May 28th, 2010
Tired of typing in the user name and password every time you ssh to a new box? Follow the directions below to get around that issue. This is a quick “How to” on setting up ssh keys. It is by no means an in-depth view of setting up keys, but it will give a quick run down on how to get them going just incase you forget…
1. Copy ~/.ssh/.pub key into a paste buffer.
2. Login into remote server
3. Run ssh-keygen -t rsa (if not already ran)
a. Choose nothing for a passphrase, just hit Enter
4. cd to remoteserver:~/.ssh/
5. vi authorized_keys
a. Paste copy buffer from step 1 into file.
6. chmod 644 authorized_keys
7. Logout and Login. You should not have to use your password.
box1$: cd ~/ (be sure to be logged in as the account you want to use)
box1$: ssh-keygen -t rsa (will create a directory called .ssh)
box1$: vi .ssh/id_rsa.pub (copy key to your copy buffer)
box1$: ssh box2 (login to remote box)
box2$: ssh-keygen -t rsa (will create a directory called .ssh)
box2$ vi .ssh/authorized_keys (paste your copy buffer in here, from box1$).
box2$ chmod 644 authorized_keys
now you should be able to ssh to box2$ from box1$ without loging in…