Skip to main content

Recover instance without SSH key - method 01

·148 words·1 min
Orlando Gentil
Author
Orlando Gentil
Jack of all trades, master of none
Table of Contents
“You lost the SSH private key to an instance. How to access it again? method 01”.

Long version
#

Losing an SSH key can be problematic and troubling. However, on OCI, it is simple to add another key to the opc user’s authorized_keys file. Follow the instructions below to regain SSH access.

Jump to TLDR for instructions.

The new SSH key will be appended to the authorized_keys file.

Be aware of the following potential issues when deleting the instance:

  • If the instance is not using a reserved IP, the IP will be recycled.
  • Creating a new instance can be challenging if you are using an always-free tenancy.

TLDR
#

  1. Delete the instance, preserving the boot volume.
  2. Recreate the instance using the boot volume of the deleted instance.
  3. Add the new SSH key in the SSH key section.

You should now be able to SSH into the instance again.