When you create a SSH keypair you can connect to your SSH server without entering a password.
Generate key with puttygen, I use ssh2-rsa/1024 as parameters.
Now copy the public key from the “Public key for pasting…” textfield into the clipboard. Fire up putty and connect to your SSH server.
I use the root user for this example:
create a file /root/.ssh/authorized_keys2 and paste the public key into this file. Change permission for this file “chmod -R og= /root/.ssh”.
You can restrict the potentials for this user by entering options in front of the pasted public key:
no-port-forwarding ssh-dss KEYKEYKEY… dsa-key-20070211
I set the option no-port-forwarding (which should speak for itself what this option is for). A “man sshd” should give you all the options you can specify in this file.
Now add a “key passphrase” to your private key and save the private key, for example as c:meepprivate-key.ppk. Start putty, load your session and add the private key to Connection / SSH / Auth / Authentication parameters. Save the session and connect. If you specified a key passphrase you need to enter the password (of the key passphrase).
Another nice tool is pageant.exe, with this tool you can add your private key and you only need to enter the password for your private key ONCE, it doesn’t matter how many times you connect to the server.