Ssh – Ubuntu EC2 instance, changed root home directory and now unable to SSH in

amazon ec2ssh

I have an Amazon EC2 instance runnung Ubuntu 11.10. In an attempt to do a quick fix of a problem I changed the home diretory for the ubuntu user in the /etc/passwd to /srv/www. Now I can't ssh in to the box (I'm assuming) because it can't find .ssh/authorized_keys

I have FTP access to the box, and I can get access to the .ssh/authorized_keys file, but the directory /srv/www is owned by root so I can't just uploaded the .ssh folder there.

Any ideas?

Best Answer

A typical approach is to stop your instance (call it A) and create another instance where you mount A's disk and fix the problem (changing /etc/passwd in your case).

Related Topic