2006-09-07

Setup ssh to use public key authentication (without input password)

Under Linux, we use ssh and scp a lot, if you don't want to enter password everytime, here is how to set it to use public/private key for authorization.

First you need to generate a public/private key pair to identify yourself, use 'ssh-keygen -t rsa'
Then you need to add the generated public key to the remote host, here is how I do it

At Local Machine
scp id_rsa.pub yjpark@exobox:
ssh-add
At Remote Machine:
mkdir .ssh
chmod 600 .ssh
cd .ssh
cat ../id_rsa.pub >> authorized_keys
chmod 600 authorized_keys
That's All

make sure that .ssh and authorized_keys is not accessed by anyone except the owner, otherwise it will not work

No comments: