Wednesday, November 16, 2005

Auto-login with sshd


If not for our very own scientist Vijayraj, this blog (and its source) would'nt have born at all. So, with all due thanks to him, here goes:

Warning: Make sure you have installed sshd (aaww, dont worry man, it comes by default).

Now, for the server configuration part. Open up /etc/ssh/sshd_config file.
In that uncomment/add the following lines.

RSAAuthentication yes
PubkeyAuthentication yes
Protocol 1

The "Protocol" key maybe absent in older versions of ssh. Its not a worry if its not there.Thats about it with the configuration file. Now for the security aspect. Go to your home directory. There enter the secret world of ".ssh". Here lies the keypass to your auto-login. There should be a file by the name of "authorized_keys". This will contain the public key to your username. If the file is not there or you dont have a public key as of now to authenticate yourself, enter puttygen.

Use this utility to generate your public and private keys at the click of a button. Copy the public key to the "authorized_keys" file. Then pass the private keys value to putty via the "Settings/Connection/SSH/Auth" menu item. The username for automatic login can be passed to putty via the "Settings/Connection/Data/Auto-login username" menu item.

After all these, just request the ssh server to restart once with " killall /usr/sbin/sshd -HUP" command. After this, logging with your username should be possible with the click of a button.

Ok, How much did I miss here????

Have "p(l)u(n)tty" of fun...