How do you add an existing key to a live EC2 instance that has no key pair?
I have tried using Session Manager to vi /.ssh/authorized_keys
and add in the public key of the pair, but I get this error:
"~/.ssh/authorized_keys"
"~/.ssh/authorized_keys" E212: Can't open file for writing
Is this something that has to be done using the console?
No associated key pair
This instance is not associated with a key pair. Without a key pair, you can't connect to the instance through SSH.
You can connect using EC2 Instance Connect with just a valid username. You can connect using Session Manager if you have been granted the necessary permissions.