Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I've run into this issue before and rebooting the instance, I assumed, reset the /root/.ssh/authorized_keys and the /home/ubuntu/.ssh/authorized_keys files.

I've reboot the instance twice now and I'm still not able to SSH in. I just get this:

Connection closed by x.x.x.x

Any ideas?

share|improve this question

2 Answers 2

reset as in delete them and create new files? If so permissions are bad that that is a security check by ssh.

needs to be the following

chown user: ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
chmod 700 ~/.ssh
share|improve this answer
I can't SSH in. – nowthatsamatt Jun 15 '11 at 4:36
yes i know.. so if you have no other account to get in.. you're out of luck – Mike Jun 15 '11 at 5:17

Rebooting the instance won't reset those files but taking an AMI of the instance and creating a new instance from the ami will cause `cloudinit to redo those files when it injects the key into the new instance. If that doesn't work then you will need to attach the volume to anouther healthy insane and fix the files from there

share|improve this answer

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.