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:
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@
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 [] 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 '' 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_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).
  • But its not entirely server issue in my opinion.Plus i dont know how to move it there. Do i need to post it again there? – Waqas Jamal Nov 11 '14 at 12:51
  • Ok, thanks @MartinPrikryl I have flagged my question for the move request. – Waqas Jamal Nov 11 '14 at 12:56
  • It looks like you pem is not the correct one. Please try to: 1. Remove the remote host from the known_host file. 2. Go to ec2 web console, right click the host, press connect. Copy the ssh command. Fix the location of the pem and try to connect. – Gluz Aug 23 '15 at 8:01
  • There can be a lot of reasons why this won't work. You should be able to find the exact reason in /var/log/auth.log – wouter Oct 7 '15 at 10:48

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

This should at least elimNate any "old" cached connections


I see some actions that change the OpenSSH and user configurations in the FTP (SFTP) server setup link. Those changes are likely the source of your problems.

Assuming a EBS-backed instance, you can resolve this by shutting down the instance (this will cause your external IP to change if it isn't a EIP). Then detach the root volume and attach it to a new host as a non-root volume (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-detaching-volume.html), then mount it and fix the openssh or user configuration.

Likely sources of issue: You added your login user to the ftpaccess group, or you set your primary user as /usr/sbin/nologin.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.