Ubuntu – AWS connection error: Permission denied (publickey)

amazon-web-servicesftpssh-keysUbuntu

Sorry if this sounds redundant to you but trust me its not. I have tried almost majority of the links related to this problem but nothing is working for me so far. I even tried this article two. Below is what I have tried so far

  1. Permission of the keys 400 as well 600
  2. ubuntu as the username because its the Ubuntu 14.04
  3. IP is correct and I even tried public dns as well
  4. Key is attached to the instance
  5. AWS Java client (MindTerm) using FireFox browser. But it gives error after i press enter when it shows me this line against my IP. Even if I get lucky it would just ask username which i give ubuntu and then it exits giving error "I/O error – read failed: unknown error" or either just take me back to the IP step.

MindTerm home: /home/waqas/.mindterm/
SSH Server/Alias: 54.191.37.141
Connected to server running SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2

Server's hostkey (ssh-rsa) fingerprint:
openssh md5:  95:44:f1:40:07:90:00:2a:7d:9a:1f:49:a1:71:8a:0b
bubblebabble: xilon-segen-tufep-manir-rekad-lucag-fetoz-sover-hyhuh-kafiz-kixox

The last thing I did before this issue was that 2 days ago I was trying to install the FTP server on my client using this link http://www.krizna.com/ubuntu/setup-ftp-server-on-ubuntu-14-04-vsftpd/. Unfortunately this link didnt work as expected and I ended up with no success in FTP logins. And today when I tried to login using my keypair its giving me error.

Below is the log for my ssh attempt

waqas@waqas-itu:~/Downloads/key$ ssh -v -i test.pem ubuntu@54.191.37.141
OpenSSH_6.0p1 Debian-3ubuntu1.2, OpenSSL 1.0.1c 10 May 2012
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 54.191.37.141 [54.191.37.141] port 22.
debug1: Connection established.
debug1: identity file test.pem type -1
debug1: identity file test.pem-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.0p1 Debian-3ubuntu1.2
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: ECDSA 80:dd:8f:50:a3:80:81:00:39:06:e4:05:6e:f3:1f:16
debug1: Host '54.191.37.141' is known and matches the ECDSA host key.
debug1: Found key in /home/waqas/.ssh/known_hosts:108
debug1: ssh_ecdsa_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
debug1: Next authentication method: publickey
debug1: Offering RSA public key: testserverpem.pem
debug1: Authentications that can continue: publickey
debug1: Offering RSA public key: waqas.jamal@***.com
debug1: Authentications that can continue: publickey
debug1: Trying private key: test.pem
debug1: read PEM private key done: type RSA
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
Permission denied (publickey).

Best Answer

Try removing the key from the known_hosts file then reattempt connection.

This should at least elimNate any "old" cached connections

Related Topic