Adding an SSH Key

SSH keys are used for passwordless access to instances. Before creating any instance, you must generate an SSH key pair and upload the SSH public key that must be associated with the instance.

  1. Log in to the UI and go to the Self Service Portal.
  2. Click Preferences.
  3. In the Preferences window, select Infrastructure - Oracle Compute in the left pane.
  4. In the Configure SSH Keys and Host Credentials region, click Add.
  5. In the Configure SSH Keys and Host Credentials window, provide the following details:
    1. Select SSH Key as the Credential Type.
    2. In the Credential Name field, enter the SSH key name.
    3. Select the user name as oracle or root.
    4. Select a credential value. If you select Enter Key, then you must specify the SSH public and private key pair required to access the VM instances. If you select Key is in a File, then click Choose File and select the public and private key from a file.
  6. Click OK.

Adding an SSH Key Using the CLI or API

Use the following command to add an SSH public key:

oracle-compute add sshkey keyname keyfile [--enabled] [--osuser]

You can associate the SSH key with the operating system user; the SSH public key is appended to the users’ authorized keys file /home/<osuser>/.ssh/authorized_keys

For more information, see CLI Reference for Oracle Compute Cloud Service.

To add an SSH Key using the API, use the POST https://api.oc.example.com/sshkey/ method.

For more information, see REST API Reference for Oracle Compute Cloud Service.