Tuesday, April 28, 2009

passwordless SSH Log in and even more secure

Suppose you want to log into your office computer very often from home computer. Its very annoying to enter password each time you open a terminal or new window in terminal. Thus I searched a bit and found a procedure to bypass entering password. And it happens to be more safer way that entering password.

1.On your Home-comp
ssh-keygen -t rsa

This will generate ~/.ssh/id_rsa.pub file

2.
cat ~/.ssh/id_rsa.pub | ssh office-user@office-comp "cat >> ~/.ssh/authorized_keys"


This will ask you password for one last time. Note that we have used cat command over ssh. Hence we will require the password at least once.

Make sure that you have following permissions on "office-comp" :
chmod 750 ~
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

No comments:

Post a Comment