Oracle by Example brandingAdd a New Public Key to an Oracle Cloud Instance

section 0Before You Begin

This 10-minute tutorial shows you how to add a public key pair to an Oracle Public Cloud Service instance.

Background

Most Oracle Public Cloud services provide their services with VMs that users can access through a secure shell (SSH). For an SSH access, when you create your Oracle Public Cloud service, you associate a public key to your service instance.

The Oracle Public Cloud Service wizard can create a public/private key pair for you. In case you want to add or update a public/private key pair that is associated to your VM, you can do it through your Oracle Public Cloud Service's console page.

Some Oracle Public Cloud services such as Oracle Storage Cloud Service don't provide access to their VMs with Secure Shell. Instead you use REST API calls to access the service. This tutorial is for cloud services that allow SSH access to their VMs and therefore, they provide you a public/private key pair for SSH access.

What Do You Need?

  • Access to an Oracle Public Cloud Service instance. For this tutorial, we use an Oracle GoldenGate Cloud Service instance.

section 1Generate the Key Pair

It's best if you use the Oracle generated keys for Oracle cloud services to avoid format issues.

  1. Open the Service Console of your cloud service.
  2. On the Instances page, click Create Instance.
  3. On the Create Instance wizard page, enter the mandatory fields and click Next.
  4. On the Service Details page, click the Edit button next to the SSH Public Key field.
  5. In the SSH Public Key for Access to the Compute Nodes dialog box, select Create a New Key and click Enter.
    Description of create-key.png follows
    Description of the illustration create-key.png
  6. In the Download Keys dialog box, click Download.
    Description of key-popup.png follows
    Description of the illustration key-popup.png
  7. In the opening sshkeybundle.zip window, click Save File.
  8. Enter a meaningful name for your key bundle, browse to the location of your choice and save it, for example, as sshkeybundle_Jack.zip.
  9. In the Download Keys dialog box, click Done.
  10. On the Create Instance wizard page, click Cancel to return to the Instances page.
  11. In your local filesystem, unzip the folder that contains the public/private key pair. For this example, sshkeybundle_Jack.zip.
  12. Rename your public and private keys. For example, from privateKey and publicKey to:

    privateKey_Jack
    publicKey_Jack


section 2Add the Key to Your Instance

  1. On the Service Console of your cloud service, identify the service instance for wich you want to update the associated public key, click the actions menu Actions menu icon, and then select SSH Access.
  2. In the Add New Key dialog box, select Upload a New Public Key option and click Browse.

    Note: The Key value field displays the current public key value that is associated with the VM of your service.

  3. Browse for you new public key and select it. For example, publicKey_Jack.
  4. After the new public key appears in the value field of the Upload a new SSH Public Key field, click Add New Key.
    Description of add-key.png follows
    Description of the illustration add-key.png
  5. In the Add New Key dialog box, confirm that you want to add the new key by clicking Submit.

    Note: Your VM is restarted and then associated with the new public key. You'll need your matching private key, such as privateKey_Jack to access the VM for this service.


more informationWant to Learn More?