Wednesday, February 11, 2015

Add RSA authentication for Oracle VM JDE Template Servers

Tools needed:
PuTTY (Download)
PuTTY Key Generator (Download)

1. Open PuTTY Key Generator, click on the Generate button.

2. Move the mouse cursor around until the Key generation bar is filled up.

3. After finished generating the key, you should be able to see something as follow:

4. Save both Public Key and Private Key in a location that you are familiar with. 

5. Copy the Public key phrase. Make sure it is in a line.

Example: 
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAghxBZAfgU277+6H0qo95siux76T3CTP+25LOzxQdYRl8X+DsaPf8F8pMNM0CCjF4wBIFGmVBzFCwANtIpmkt2G7fib9ckjHT9FfQhydQeMQQZ+SmQeD2imOj4S+FRLzQg5Et/wixr7WXAybJzpBa1UrJ+u7izC3y7+/20RtlzIrEf5MmEOqvYIFpQn0n+pCweCHo1haYPeXMOYpda7Xwd2CAEUk/sq/dqGLJwHVtuB4sr3mTv/7wXvhAMgJxgId6vFh2G8sw6x+f+cuLd/oJxLILilugw1QxhrbtsDtENhM1AP9ms26LHkAmczFM9/JdMV0pobeLXNLULxlO1SPwlw== rsa-key-20150211

6. Open PuTTY.exe and login to target server which you want to use RSA Authentication.


7. Once login, make sure you are on the root home folder (/root). Enter the following command line by line:

# mkdir .ssh   
# chmod 700 .ssh
# cd .ssh
# vi authorized_keys

Paste the public-key copied from step 5 and save the file by click on esc key from the keyboard and then type :wq

8. Open PuTTY.exe again. 
For Host Name, type in the root@[server IP address]. Put a name of your preference in the Saved Sessions text box. 

9. From the left panel, Click on Connection -> SSH -> Auth. Click Browse, navigate to the location where the private key is saved from Step 4.

10. Once the private key is added, go back to Session, make sure the hostname and saved sessions is correct. Then click on the Button Save.

11. To test that the configuration is correct, select TESTSERVER and click the Open button. 

12. You should see the screen similar like below if it is successful.