Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What happens if you set up a server or VM and put your ssh keys on there, then you disable password authentication. Then, you somehow lose your private key and can no longer authentication to the machine with a key. How does one access the machine?

share|improve this question

You'd have to access it physically (IE with a keyboard) and change sshd_config to allow password login, before changing the key stored on the server.

share|improve this answer
So if this was in xen/kvm or a similar hypervisor, it would involve bringing up a console and logging in via password to a server account? – Peter Dec 22 '12 at 23:21
Exactly; if it's a self-hosted VM then that's what you'll have to do, some VPS providers and cloud VM hosting services may have their own automated way to do this though. With Amazon EC2, for example, I'm pretty sure you can upload a new public key from the web interface. – jackweirdy Dec 23 '12 at 0:09

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.