AWS EC2 instance can't connect to ssh or SFTP "all of a sudden"

0

I have an instance set up on AWS. It's an Ubuntu 12.04 server, and I can no longer log into ssh or sftp using my key.

I was logged into both ssh and sftp at the same time on a mac using terminal for ssh and cyberduck for sftp. I closed Cyberduck to go up for lunch and when I can back, I could no longer log in. I thought SFTP was the problem, but I closed the terminal also and could no longer log into the terminal.

When trying to log into ssh I get the following error:

Permission denied (publickey).

And when I try to log into SFTP, I get the following:

Login failed Login with username and password

I've made sure all of my login info is correct. Even if I didn't the info was bookmarked and working on cyberduck before it quit connecting.

The key has not changed nor has it changed places. I tried creating a new key, but got the same result. Nothing has change in the dashboard or on Amazon's side. The only thing I can think of that changed was I set the permissions of /var/www/ to 757 an then uploaded a large folder to it. Could that cause such a problem?

What are possibilities? Google hasn't offered me anything useful.

Christian

Posted 2013-08-06T18:48:09.790

Reputation: 101

Answers

0

Unless /var/www was the home directory of your account on the remote host, it is unlikely the upload or permission change affected it. 757 is an odd permission setting though: read/write/execute for everyone, but not writable by group? Is that what you meant to set?

Connecting with ssh -v hostname will give you some debug messages that can help. For example the permissions on your local private key file needs to be readable only by you and ~/.ssh/ directory can't be writable by others, otherwise ssh will refuse to connect. The debug message will tell you that.

ianjs

Posted 2013-08-06T18:48:09.790

Reputation: 156