0

I have an Ubuntu 12.04LTS instance on AWS EC2 and I upgraded it to 12.10 following the instructions at https://help.ubuntu.com/community/QuantalUpgrades.

After upgrading I can no longer ssh into my VM. It isn't accepting my ssh key and my password is also rejected. The VM is running, reachable, and SSH is started. The problem seems to be about the authentication part.

SSH has been the only way for me to access that VM. What are my options?

ubuntu@alice:~$ ssh -v -i .ssh/sos.pem  [email protected]
OpenSSH_5.9p1 Debian-5ubuntu1, OpenSSL 1.0.1 14 Mar 2012
debug1: Reading configuration data /home/ubuntu/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to www.hostname.com [37.37.37.37] port 22.
debug1: Connection established.
debug1: identity file .ssh/sos.pem type -1
debug1: identity file .ssh/sos.pem-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1
debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: RSA 33:33:33:33:33:33:33:33:33:33:33:33:33:33
debug1: Host '[www.hostname.com]:22' is known and matches the RSA host key.
debug1: Found key in /home/ubuntu/.ssh/known_hosts:12
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: .ssh/sos.pem
debug1: read PEM private key done: type RSA
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: password
[email protected]'s password:
debug1: Authentications that can continue: publickey,password
Permission denied, please try again.
2
  • Have you looked at the instance log? Sep 8, 2013 at 4:08
  • I checked the system log thru AWS console (green letters on black background) and it looks very cryptic. I am sure I can tell the anomalies from it, but from what I can see only mysql process failed to start. The rest seems ok
    – Quoc Vu
    Sep 8, 2013 at 5:48

4 Answers 4

1

are you sure you have the right password?

otherwise maybe you should try the EC2 support system.

0

Check /var/log/auth.log on the server. That should tell you why sshd rejected the connection.

1
  • I can no longer access the server. It's a EC2 VM and ssh was the only way in. I don't have a console access.
    – Quoc Vu
    Sep 9, 2013 at 4:05
0

Well, check this file in the client side: /etc/ssh/sshd_config, and ensure you have

RSAAuthentication yes
PubkeyAuthentication yes

Then do this:

sudo grep 'sshd' /var/log/secure | grep 'Authentication refused' | tail -5

If you get this: "Authentication refused: bad ownership or modes for directory", change the permissions for that or those directories:

sudo chmod 0755 directory

And then try again.

4
  • i do not have a /var/log/secure file on the client side.
    – Quoc Vu
    Sep 9, 2013 at 17:06
  • Well, try this like the second command: sudo grep -r 'sshd' /var/log/ | grep 'Authentication refused' | tail -5
    – Manolo
    Sep 10, 2013 at 7:05
  • thanks Manolo. But the command yields no match
    – Quoc Vu
    Sep 11, 2013 at 3:31
  • Have a look at this tutorial: ubuntuforums.org/archive/index.php/t-30709.html. Maybe you find out a solution.
    – Manolo
    Sep 11, 2013 at 7:21
-1

Try ensuring that you have the latest version of sshd installed. If you already do have the latest version, try running

$sudo apt-get remove --purge ssh

then reinstalling ssh.

1
  • 1
    I can no longer access the server. It's a EC2 VM and ssh was the only way in. I don't have a console access.
    – Quoc Vu
    Sep 9, 2013 at 4:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .