Oracle Cloud SSH
Intro
I highly recommend using Oracle Cloud’s free tier for anyone wishing to play around in Cloud Computing or even wishing to host a few free servers or services. In order to host a server or service though you will need to be able to SSH into the VM. This guide will assume that you are about to create a VM or have saved the private key “.key” file generated by OCI when you were creating the instance.
PuTTYgen
The first step is to convert the private key “.key” file into a private key with the extension “.ppk” to be used in Putty.
In order to do so open Puttygen on your computer and click on the load button where it says “Load an existing private key file”. Change the file type dropdown to allow all files extensions (to right of the file name field) and then locate the “.key” file and select it. Select ok confirming you have successfully done so and then select the “Save private key button” and select “Yes” on the popup to confirm you are doing so without a passphrase. Finally name the file appropriately and save the file in an appropriate location.
PuTTY Connection
In order to connect to the VM copy the public IP address of the VM and then open Putty. Paste the public IP address into the field which says “Host Name or IP Address”. Next expand the “SSH” menu on the left hand side and then select “Auth”. Select “Browse” in order to locate and select the private key file for authentication which we previously generated using PuTTYgen. The last step is to also enter the username you will use to sign in if you wish to save this connection. In order to do so, go to the “Connection” menu on the left hand side and enter “ubuntu” as the “Auto-login username”. At this point you can return to the session menu and enter a session name and hit save or simply hit the “Open” button if you wish to not save and connect immediately.
If you saved the session you can always recall the settings by clicking on the name the session was saved as and then clicking load followed by the “Open” button in order to start the connection.
Recommendations (SSH Tunnel/Reverse Proxy)
I would also like to recommend setting up a SSH tunnel or reverse proxy as it may prove useful when required. The purpose of the tunnel/proxy is to allow you to browse the internet as if you were doing so from the system you are connected to.
In order to set it up you simply need to expand the “SSH” menu in PuTTY and then select tunnel. There we you need to enter a port such as “5432” into the source port field, select dynamic and then click add. You should then see “D5432” added as a forwarded port.
The second part of the proxy involves configuring a browser (I recommend Firefox). To configure your browser to use the proxy go into your network settings and select “Manual proxy configuration”. Add “127.0.0.1” as the SOCKS host and use “5432” as the port. Ensure to select “SOCKS v5” as the version and then click on ok.
Please note if you configure your browser to use the proxy you will need to be connected to the server via SSH in order for internet to work using the browser. If you wish to use your browser un-proxied simply change the proxy settings.
