Set up PAGENT to Forward Keys for Auto-login without User Prompt
Steps to set up RSA and DSA SSH Key Authorization to automatically connect to a Unix Server without being prompted for a password.
Download the PuTTY Software – http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html


Download PuTTY, PSCP, PSFTP, PuTTYgen, and Pagent These are all executables. You do not need to unzip or extract any of the downloads. Put these files into a directory that is in your Environment PATH variable so you do not have to qualify the executable with a path. I put these files right into C:\Windows\system32. If you choose a different directory you will have to update your
PuTTY Key Generator

1) puttygen.exe is the executable that you run to generate the private/public key combinations.
2) I download and move the PuTTY executables into my C:\Windows\System32 director. If you choose a different location you need to update your environment variables to include the directory you choose to store the executables in.
3) execute puttygen.exe
4) Go to the bottom section and to generate the first key combination select SSH-2 RSA (in the Parameters->Type of key to generate:) section and enter 1024 as the value for Number of bits in a generated key:
To generate the key click on the Generate Action button and move your mouse around the screen until the key has been generated.
5) The text that appears in the box below the description: Public key for pasting into OpenSSH authorized_keys file: is the text that you will use to concatenate at the end of the authorized_keys file on the server.
6) Put you mouse into the text box and right-click, using the Mouse Menu click Select All, then right-click and Select Copy
7) Use Notepad.exe to create a blank text file – paste the text from your buffer into the blank text file. Save the file in the directory location that you will use to store your public and private keys and I use the same directory to save all of my PuTTY related files and I put this on my Desktop so I can easliy acccess it. Name this file something that is meaningful to you, I use the hostname of my workstation prefixed to pub. For example: imac.pub.
Next click on the Save public key button and enter in the name of your RSA publick key, example: username-rsa.pub
9) Click on Save private key and enter in the name of your RSA private key, example: username-rsa.ppk
PuTTY Key Generator – Step-by-Step for DSA

1) Invoke the PuTTY Key Generator by typing in puttygen.exe and if you have updated your environment variable(s) Windows will locate the executable and invoke it.
2) Select Type of key to generate: SSH-2 DSA and enter 1024 for the Number of bits in a generated key
3) Click on the Generate button.
Step to Generate the Key Pair

1) Click on the Generate button and move the mouse around your screen to generate the key.
Save public key as:

1) Save your public key: Click on the Save public key button and enter the name for your public key file
Save your private key file.

1) Click on the button Save private key and you will see the above pop-up box, just click Yes.

1) Select the path and the name of the file you want to use for your private key file. Example: imac-dsa.ppk
Set up Pageant – PuTTY Key Agent

PuTTY Key Agent – this is the executable that you run that handles the forwarding of the keys between machines.
1) pagent.exe – start up the pagent.exe
2) you can create a command macro to start this up in the future or do as I did and create a Windows Service to start up the program and load the keys at boot time.

1) Select your private key files, one for RSA and one for DSA, and load them both in at the same time or one at a time if you prefer.
Screenshot displaying the Pageant Key List with the keys loaded.

Create a Command Macro to start a PuTTY Session.

1) Use Notepad or your favorite text editor to create a macro file to start up the indivdual PuTTY (SSH) sessions. You need to have a PuTTY session or profile defined for each server and userid combination you want to create a macro for. The command line syntax is as follows: putty -load <profile name>.
2) The start command instructs the Operating System to execute the macro and exit so if you run the command macro from a DOS Shell the DOS Shell won’t wait until the session exits.
3) Give the file whatever name you want. For example I name mine as follows: <server>-<user>.cmd
4) The “cmd” extension instructs the Operating System to treat this file as an executable command macro.
5) I save the macros I create in the same directory with my keys so I can easiliy locate these files.

Example of signing into a server using Oracle without being prompted for a password.
