SSH Login to Remote PCs Without Typing Your Password

Recipe # | posted in Faq, Howto | Comments

1 – Problem Description

Login to a REMOTE pc via SSH without typing your password, thus less-tiredomâ„¢ :P

2 – Solution

Let’s assume that your pc is named beast and your login name is sexy

  1. First create an RSA key for your beast typing in shell

    ssh-keygen

  2. Then create an RSA key on REMOTE pc

    slogin REMOTE

Type your password and then execute

ssh-keygen
ssh-copy-id beast

and you are done!

If ssh-copy-id is not available, keep reading

cat .ssh/id_rsa.pub | ssh sexy@beast 'cat >> .ssh/authorized_keys'
  1. Return to your pc, beast

    exit

  2. Copy beast key to REMOTE

    cat .ssh/id_rsa.pub | ssh sexy@REMOTE ‘cat >> .ssh/authorized_keys’

That’s all man, now you can login without typing your password! ;)

If you still cannot login try to change the permissions in REMOTE

slogin REMOTE
chmod 700 .ssh
chmod 640 .ssh/authorized_keys2

3 – References

[1] sexy@beast

Comments