SSH keys in 2 easy steps February 13, 2010These are simple instructions that will let you ssh from one Linux machine to another without needing to type your password.
Step 1) Generate your public signatureOn your local machine (where you are ssh-ing from) type:
ssh-keygen(Then hit ENTER to accept the default output file of ~/.ssh/id_rsa.pub and ENTER again twice if you're lazy and want to use a blank passphrase.) Note that you only have to generate a key once per client machine - the same public key will be used to access all servers.
Step 2) Copy your public signature to the serverAgain, from your local machine, type:
cat ~/.ssh/id_rsa.pub | ssh email@example.com "cat >> ~/.ssh/authorized_keys"(but replace firstname.lastname@example.org with your actual user and server.)
This fancy shell command appends the contents of your public signature to the end of the ~/.ssh/authorized_keys file on the server. (If you did a simple scp it would overwrite any previous authorized keys you've stored.)
You're done!Next time you ssh into the server
ssh email@example.comIt should do this without prompting for any passwords. blog comments powered by Disqus