AWS连接错误:权限被拒绝(公钥)

对不起,如果这听起来多余,但相信我不是。 我已经尝试了几乎大部分与这个问题有关的链接,但到目前为止还没有任何工作。 我甚至试过这两篇文章。 以下是我到目前为止所尝试的

  1. 还允许密钥400的许可600
  2. Ubuntu的用户名,因为它的Ubuntu 14.04
  3. 知识产权是正确的,我甚至尝试过公共DNS
  4. 密钥附加到实例
  5. AWS Java客户端(MindTerm)使用FireFox浏览器。 但是,当我按下input时,它给我错误,当它显示我这条线对我的IP。 即使我很幸运,它会问我给Ubuntu的用户名,然后退出给出的错误“I / O错误 – 读取失败:未知错误”,或者只是带我回到IP步骤。

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 

在这个问题之前我做的最后一件事是2天前我试图在我的客户端上使用这个链接安装FTP服务器http://www.krizna.com/ubuntu/setup-ftp-server-on-ubuntu-14 -04-vsftpd / 。 不幸的是,这个链接并没有如预期的那样工作,我最终没有在FTPlogin成功。 而今天当我尝试login使用我的密钥对给我错误。

以下是我的ssh尝试的日志

 waqas@waqas-itu:~/Downloads/key$ ssh -v -i test.pem [email protected] 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). 

尝试从known_hosts文件中删除密钥,然后重新尝试连接。

这至less应该删除任何“旧”caching的连接

我看到了一些改变FTP(SFTP)服务器设置链接中的OpenSSH和用户configuration的操作。 这些变化可能是你的问题的根源。

假设一个EBS支持的实例,你可以通过closures这个实例来解决这个问题(如果这个实例不是EIP的话,这将导致你的外部IP更改)。 然后分离根卷并将其作为非根卷附加到新的主机上,然后将其装入修复openssh或用户configuration。

可能的问题来源:您将login用户添加到ftpaccess组,或者将您的主用户设置为/ usr / sbin / nologin。