In my previous post, I wrote about on how to deploy an Ubuntu server on an Oracle Cloud virtual machine. To administrate the virtual server, we can access Ubuntu server on Oracle Cloud through SSH using PuTTY.
Remember the private key that had to be downloaded prior to deploying the Oracle Cloud compute instance? Yes we need that that private key file to be able to login into the Linux server.
If you missed that part, then don’t fret. You can just terminate the virtual machine and create a new one, even whilst the termination is still running for the server you want to delete. It only takes less than five minutes to complete.
Once done, you can jump right back in.
Access Ubuntu server on Oracle Cloud through SSH using PuTTY
But before that, lets get to know the glamorous SSH a little bit better. SSH stands for Secured Socket Shell and is a network protocol usually used by your lovely system administrators to manage other devices securely over an unsecured network.
The name PuTTY on the other hand has no meaning. PuTTY itself is a software that emulates the terminal, can be used to connect to serial consoles and network file transfer applications. Several network protocols such as SSH, Telnet, rLogin and raw socket connection are supported by this free and open source software.
Lets begin to Access Ubuntu server on Oracle Cloud. You need to have PuTTYgen and Putty installed on your computer to achieve this. PuTTYgen is used to convert the private key downloaded prior to the deployment of your Ubuntu server in Oracle Cloud into a type of file that PuTTY can read called PuTTY Private Key File (.ppk).
Head over to PuTTY’s page and download the latest 32-bit or 64-bit MSI version. To check whether your machine is which version, simply right click on ‘This PC‘ or ‘My Computer‘ and click on ‘Properties‘. It should list out your Windows operating system version.
Do note that PuTTYgen will be installed alongside PuTTY. So there will only be one installer needed to get these two software.
Converting a .KEY into .ppk using PuTTYgen
Launch PuTTYgen and then click on the ‘Load’ button.
After that, locate the private key file (.KEY) which you have downloaded from Oracle Cloud compute and open it. You may need to change the file format selection to ‘All files’ to able able to see the file in the selection window.
If the conversion of the .KEY file to .ppk is successful, you’ll see a notification as shown below.
Go ahead and save it by clicking on the ‘Save private key‘ button to your preferred location. We’ll next continue with setting up PuTTY before we can access Ubuntu server on Oracle Cloud.
Setting up PuTTY to access Ubuntu server on Oracle Cloud
Now launch PuTTY and on the left hand side there would be a list. Under the ‘Window‘ tree, select ‘Translation‘ and ensure that the ‘Remote character set‘ drop down menu is set to ‘UTF-8‘.
Next, in this guide to access Ubuntu server on Oracle Cloud, under the ‘Connection’ tree, open up ‘SSH‘ and select ‘Auth‘. Click on the ‘Browse‘ button and open up the converted private key file. It should be the one in the .ppk format.
Once those two settings are completed head back to the ‘Session‘ window and set the ‘Hostname‘ to ‘ubuntu@yourIPAddress‘, i.e ‘ubuntu@159.212.45.3‘.
Ensure that SSH is checked at the ‘Connection type‘ selection, give your settings a name at the ‘Saved Sessions‘ section and click on save. It should be something like below. I saved mine as ubuntuOCI.
Now the fun part begins. Click ‘Open‘ to start remoting into your freshly made Ubuntu 20.04 LTS virtual machine.
As always, run the command below to get to get your Ubuntu installation up to date and secured.
sudo apt update && sudo apt upgrade -y
Conclusion: access Ubuntu server on Oracle Cloud
Using PuTTY to access Ubuntu server on Oracle Cloud is quite simple. All you need is PuTTYgen, PuTTY and the private key file for authentication.
And always remember to update your Ubuntu installation at a set interval to ensure that it is secured so that your applications and services runs smoothly.
Since Oracle is generous enough to provide two virtual machines for free, you can as well use the second server as staging ground to check whether the updates break anything before running it on your production server.