In this post, I have discussed Generating an SSH Key Pair for Oracle Cloud (Windows/Linux)
Note: Oracle Cloud Services are built on top of OCI, You will need an SSH key pair to access the Linux/Database or Exadata instances. An SSH key pair comprises a Private key and Public key. You keep the private key on your personal computer and provide the Public key every time you launch an Instance.
You can associate a single SSH public key with multiple Linux machines (Compute/Database instances).
Steps To Generate SSH Key Pair
What Do You Need
PuTTY: PuTTY is a free, open-source implementation of several network protocols, including SSH. It is available for Windows and for UNIX platforms. PuTTY includes several utilities including a terminal emulator, an SSH key generator, and a network transfer application.
For this post, we will use the PuTTY Key Generator (puttygen.exe) for Windows. Download PuTTY (64bit) From here & Click Here to Download for 32bit
Note: Once you Install the PuTTY on your machine you can easily run PuttyGen
The below process to be followed to generate Private and Public Keys by Using PuttyGEN
1) Download Puttygen Software from the location given above.
Once done, go to Windows -> Start Menu -> All Programs -> PuTTY -> PuTTYgen.
2) Open PuttyGEN, it will show like below:
Note: Make sure the below configuration is selected
3) Click on Generate Button and hover your mouse around the area blank area randomly to generate the keys.
4) There will be a key generated in the blank box, as shown below. Click on the Save private key button to save the private key in your system.
Note: We can also save private keys without passphrase but for security reasons, you can enter a passphrase. (In production you must use a passphrase to protect your private key).
5) For saving public key, first, copy and paste the Key content in notepad file from the shown window as sometimes it shows issue while accepting public key file (During Instance creation). In that case, we can use the copied key content.
Note: Make sure you select the option to copy the key content during Instance creation as we faced issues in the past if we select the directly saved key.
6) After that click on Save Public Key to save the file and save at the same location where you have saved the private key in your system.
Creating an SSH Key Pair on Linux
1) Open a shell or terminal for entering the commands.
2) At the prompt, enter ssh-keygen and provide a name and passphrase when prompted.
The keys will be created with the default values: RSA keys of 2048 bits.
Alternatively, you can type a complete ssh-keygen command, for example:
ssh-keygen -t rsa -N "" -b 2048 -C "<key_name>" -f <path/root_name>![]()
Connect to the Compute/Database Instance
You can connect to a running instance by using a Secure Shell (SSH) for Linux or Remote Desktop connection for Windows. To connect to a Linux instance from your Laptop, you can download a free SSH client called PuTTY from here
Enter the Public IP Address in the Hostname, then add the SSH Private key (Which we have created above) under SSH & then Auth. Click Open
Now as I always say, you learn when you perform
Task for You
- If you don’t have an Oracle Trial Account then go and register using my Step by Step Activity Guide Absolutely FREE
- Create a Linux or Windows Machine (Make sure you have SSH keys ready if you are creating a machine on Linux)
- Connect to the machine you have created, for Linux use PUTTY or for windows use Remote Desktop or RDP
Post your Doubts in the comments below. If you like this post, share it with your colleagues.
Related/Further Readings
- Create Compute (Linux/Windows Machine) On Oracle Cloud (OCI)
- [Video] Oracle Cloud Infrastructure (OCI) | Compute CPU & Memory
- [Video] How To Create Database on Oracle’s Gen2 Cloud (OCI)
- [Troubleshooting] Compute (Linux/Windows) & Database Instance Connectivity Issue in Oracle Cloud (OCI)
If you want to take your career to next level by becoming Oracle Certified Cloud Architect even if you are a beginner then I would like to invite you to join my FREE Masterclass on How To Become Oracle Certified Cloud Architect [1Z0-932] in 8 Weeks. Click on the image below to register for FREE
The post How to Generate SSH Keys Pair for Oracle Cloud (Windows/Linux) appeared first on Oracle Trainings.