Remote Virtual Machine in Cloud using Powershell and Ubuntu

Nadia Wartiningrum
3 min readOct 2, 2021

--

When you create Virtual Machine(VM) in cloud, you will get the private key. The private key use for remote the VM. Here I will show you how to remotely VM on Oracle Cloud using powershell (windows) and ubuntu.

In Oracle Cloud you can find your VM in Compute>Instances. Make sure that the VM is running. If your VM is not turned on, click start.

Powershell Command

If you using Windows, you can remote your VM with Windows Powershell. You should know where you keep the private key.

  1. Run your Powershell
  2. Follow this command: ssh -i <private_key_file> <username>@<public-ip-address>
  • <private_key_file> is the full path and name of the file that contains the private key associated with the instance you want to access.
  • <username> is the default username for the instance. For Oracle Linux and CentOS images, the default username is opc. For Ubuntu images, the default username is ubuntu.
  • <public-ip-address> is your instance IP address that you retrieved from the Console.
  • I keep my private key in Donwloads folder, so I have to go to the downloads folder.
  • Then oracleprivatekey.key is my oracle private key name. You have to full this command yours.
  • opc is the username in VM and 158.101.92.176 is the public IP address. public ip will be different every VM, so match yours.

3. If you’re connecting to this instance for the first time, you need to accept the fingerprint of the key. To accept the fingerprint, type yes and press Enter.

Congrats!! you can remote your VM using Powershell.

Ubuntu Terminal command

If you using Ubuntu, you can remote your VM with Terminal. You should know where you keep the private key. The steps are the same as powershell, but you have to do permission for the private key file.

  1. Run Terminal
  2. Changes permission

I keep my private key in home. The name is oracleprivatekey.key . Then, to changes permission, follow this command and enter.

chmod 400 <private_key_file>

3. Follow this command: ssh -i <private_key_file> <username>@<public-ip-address>

This command is same with remote using Powershell.

Okay, now you can remote your VM using Terminal Ubuntu.

If you want know how to creare a virtual machine in oracle cloud, you can click this.

--

--

Nadia Wartiningrum

Hello, I'm a long life learner and always improve myself to be the best I can.