1

I always log in to my server(Amazon EC2) by: ssh -i blahblah.pem [email protected] This morning the server asked for a password which I never set.

I thought this could mean either my key(pem file) is corrupted somehow. Asked a friend to log in from another computer with his own copy of the pem file, he had the same problem.

Totally confused why this would happen all of a sudden, but I remembered I did this last night (which I thought was unrelated.):

/root had permissions 700.
chmod 770 root
then put it back by
chmod 700 root

made a mistake, but thought it would have no effect though.

Any suggestions to logging to my server? I am very confused by this, and I cannot create a new .pem file for my amazon ec2 instance. Thanks for the help!

1
  • Ooh - you don't want to be logging in as root! That is what sudo and su are for! I hope your friend isn't also logging in as root...
    – dunxd
    Nov 8, 2010 at 21:57

2 Answers 2

2

Did you chmod -R to 770, then non-recursive back to 700? You could have screwed up perms on ~/.ssh.

2

The OpenSSH daemon checks the permissions of the .ssh directory as well as the files in it during the login process. If the permissions allow others to read or write the directory or certain files in it, the daemon will prevent that user from logging in.

You can try logging in using a different user. You really shouldn't be logging in and doing everything as root anyway.

If your EC2 server is EBS-backed, you can bring up another ec2 instance and mount the EBS volume on the new instance so that you can fix the permissions. Just make sure the EBS volume's "delete on termination" setting is set to "false" before you shutdown the original instance.

1

You must log in to answer this question.