Locked out of EC2 ubuntu instance because of /home perms
Following Tim's suggestion:
I clicked Launch Instance
to create a new instance. I just took whatever the first AMI was listed (some Amazon version of Linux) and created it with defaults, using a keypair I had already on hand.
I then clicked on Volumes
and detached the EBS volume from my hosed machine. This took about 30 secs. Then I selected Attach Volume
and I attached it to the new instance as /dev/sdf
. Then I ssh
ed into the new instance.
In the new instance I typed
$ sudo mkdir /caribou
$ sudo mount /dev/sdf1 /caribou
$ cd /caribou
$ sudo chmod 755 home
That repaired the /home
dir permissions.
I then went back to the EC2 console, detached the EBS volume from the Amazon instance and re-attached it to my original Ubuntu instance as /dev/sda1
. Then I started the old instance and logged in, with everything fixed.
Took 30 mins including time to figure out all of the above. Thanks to Tim.