Deleting an SSH Public Key

When you no longer need an SSH public key, you can delete it.


When you delete a key that’s associated with an instance, the instance continues to be accessible using ssh. But before re-creating the instance, you must remove the deleted key from the orchestration of that instance. Otherwise, the orchestration won’t start.


  • To complete this task, you must have the Compute_Operations role. If this role isn’t assigned to you or you’re not sure, then ask your system administrator to ensure that the role is assigned to you in Oracle Cloud Infrastructure Classic Console. See Modifying User Roles in Managing and Monitoring Oracle Cloud.


You should always use your orchestrations to manage resources that you’ve created using orchestrations. Don’t, for example, use the web console or the CLI or REST API to delete an object that you created using an orchestration. This could cause your orchestration to either attempt to re-create the object and associated resources, or to go into an error state.

If you created the object using orchestration v1, then you can delete the object by terminating the orchestration. See Terminating an Orchestration v1.

If you created the object using an orchestration v2, then you can delete the object by suspending, terminating, or updating the orchestration. See Suspending an Orchestration v2, Terminating an Orchestration v2, or Updating an Orchestration v2.


  1. Sign in to the Compute Classic console. If your domain spans multiple sites, select the appropriate site. To change the site, click the Site menu near the top of the page.
  2. Click the Network tab, and then in the Network drop-down list, click SSH Public Keys.
    The SSH Public Keys page is displayed.
  3. Identify the SSH key that you want to delete. From the menu icon menu, select Delete.

To delete an SSH public key using the CLI, use the opc compute ssh-key delete command. For help with that command, run the command with the -h option. For the instructions to install the CLI client, see Preparing to Use the Compute Classic CLI in CLI Reference for Oracle Cloud Infrastructure Compute Classic.

To delete an SSH public key using the API, use the DELETE /sshkey/name method. For more information, see REST API for Oracle Cloud Infrastructure Compute Classic.