Monday, July 9, 2007

passphraseless + passwordless ssh howto

Hi. I am back.

After doing the passwordless ssh howtos, you just need a few steps away to also have a passphraseless + passwordless ssh connection.

Passphraseless and Passwordless SSH Howto

From the same local box mentioned from passwordless ssh, simply create a new rsa pair keys as root

# ssh-keygen -t rsa -b 1024

and overwrite the old rsa key file. Do not skip the passphrase this time. You need to enter your passphrase for 2 consecutive times. The output files are the same old files :

/root/.ssh/id_rsa
/root/.ssh/id_rsa.pub

and you need to transfer /root/.ssh/id_rsa.pub to same remote .ssh folder and save it as authorized_keys. The other way around is

FROM YOUR LOCAL BOX:

# cat /root/.ssh/id_rsa.pub

Using your mouse, right click and copy the last line that starts with ssh-rsa.

FROM REMOTE BOX:
Then from remote box, edit your existing authorized_keys under .ssh folder , and paste the
copied data into the last portion of the file.

BACK TO LOCAL BOX:

As root, issue

# ssh-add

and enter the passphrase you last used when you created the rsa pair keys .

Finally, close all ssh sessions and try out your new passwordless and passphraseless ssh setup.

Take note that, the below should be present with /etc/ssh/sshd_config

RSAAuthentication yes

if not, just enable it by changing

RSAAuthentication no

to

RSAAuthentication yes

and restart your ssh

/sbin/service sshd restart

HTH

0 comments:

Sign up for PayPal and start accepting credit card payments instantly.
ILoveTux - howtos and news | About | Contact | TOS | Policy