当前位置: 首页 > 知识库问答 >
问题:

Amazon实例不再允许使用私钥登录

刘松
2023-03-14
  1. 使用了不正确的密钥
  2. 用户名不正确。这是一个Ubuntu映像,我尝试了“Ubuntu”、“ec2-user”和我在机器上为自己创建的新用户名。没有工作;所有错误消息都相同。

两个实例都建议尝试:ssh-i kename.pem username@host-vvv,这是我过去一直采用的方法....直到我重新启动了我的客户机。从那以后,我得到了附加的ssh跟踪。

我尝试了第二级的尝试,从我被锁定的服务器创建AMI,旋转一个新实例,创建一个新密钥,并尝试登录到新实例。没运气。

所以,我的问题是:是否有一些可能存在于旧机器上的东西,可能是我的公钥或其他东西,但我不再拥有,因此无法连接到任何实例?我的印象是你只需要私钥就可以进行身份验证。除了使用SSH登录到机器之外,我对SSH协议非常了解,下面的跟踪似乎没有给我任何提示,说明它在哪里发生了故障,除了“debug1:服务器不允许漫游”,但也许这不相关,我要做的是更大的事情。

我希望这个问题的重新成像部分能为这个问题提供一些其他的启示。

OpenSSH_5.9p1, OpenSSL 1.0.0e 6 Sep 2011
debug2: ssh_connect: needpriv 0
debug1: Connecting to **hostname** [**hostname**] port 22.
debug1: Connection established.
debug1: identity file /.ssh/id_rsa type -1
debug1: identity file /.ssh/id_rsa-cert type -1
debug1: identity file /.ssh/id_dsa type -1
debug1: identity file /.ssh/id_dsa-cert type -1
debug1: identity file /.ssh/id_ecdsa type -1
debug1: identity file /.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1.4
debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1.4 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.9
debug2: fd 100 setting O_NONBLOCK
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-dss-cert-v00@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: zlib@openssh.com,zlib,none
debug2: kex_parse_kexinit: zlib@openssh.com,zlib,none
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: mac_setup: found hmac-md5
debug1: kex: server->client aes128-ctr hmac-md5 zlib@openssh.com
debug2: mac_setup: found hmac-md5
debug1: kex: client->server aes128-ctr hmac-md5 zlib@openssh.com
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA ea:b9:58:59:16:ff:cc:89:72:50:ab:f7:8f:40:ef:3b
The authenticity of host '**hostname** (**hostname**)' can't be established.
ECDSA key fingerprint is ea:b9:58:59:16:ff:cc:89:72:50:ab:f7:8f:40:ef:3b.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '**hostname**' (ECDSA) to the list of known hosts.
debug1: ssh_ecdsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /.ssh/id_rsa (0x0)
debug2: key: /.ssh/id_dsa (0x0)
debug2: key: /.ssh/id_ecdsa (0x0)
debug1: Authentications that can continue: publickey
debug3: start over, passed a different list publickey
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /.ssh/id_rsa
debug1: could not open key file '/.ssh/id_rsa': Invalid argument
debug1: Trying private key: /.ssh/id_dsa
debug1: could not open key file '/.ssh/id_dsa': Invalid argument
debug1: Trying private key: /.ssh/id_ecdsa
debug1: could not open key file '/.ssh/id_ecdsa': Invalid argument
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
Permission denied (publickey).

共有1个答案

宣熙云
2023-03-14

你要加入你正在尝试的确切命令吗?

和ls$home/.ssh的输出?

如果仔细阅读stacktrace,那么SSH似乎在默认位置没有找到任何键。服务器回复您没有提供正确的密钥,调试输出告诉我您没有提供任何密钥。

 类似资料:
  • 问题内容: 在MySQL中,我有一个用户芒果。当我创建它时,用户可以完美地工作。但是,重新启动计算机后,尝试登录芒果会产生以下输出: 这让我想起了密码哈希,因此在调查mysql.user之后,我发现mangos没有密码!我更新了密码: 现在,我得到: 与mangos的mysql.user密码栏中显示的数字相同,并且与原始数字不同。我仍然无法登录。 如何使MySQL正确识别密码? 这就是这里的问题吗

  • 最初的应用程序使用了基于XML的配置,所以我选择继续这样做。应用程序被设置为使用DAOAuthProvider,如果登录失败,则使用LDAP身份验证Provider。 我移植了应用程序,现在它启动了。我可以使用带有InMemoryDaoImpl bean的DaoAuthenticationProvider登录到应用程序,该bean保存凭据和角色。 但是,我面临的问题是: 日志段: 2014-07-

  • 问题内容: 我遇到一个问题,我的图表(使用AJAX-POST-PHP)没有出现在亚马逊上 http://cdpmotest.s3-website.eu- central-1.amazonaws.com/ 它说(错误的方法405错误) 这是我的CORS Config: 这是我的脚本: 在localhost(WAMPServer)上工作正常 你能帮我吗? 问题答案: 该错误的直接原因与CORS无关,实

  • 我目前正在我的项目中使用Android导航架构。它有一个功能,可以通过快捷方式启动任何片段。目前我正在使用NavController在单击快捷方式时导航到所需的目的地。但是当我多次单击快捷方式时,每次都会创建一个新的片段实例。所以,我的问题是,有没有办法在使用NavController导航到一个片段时只接受一个片段实例?我谷歌了很多次,但一无所获。提前感谢。

  • 问题内容: 我正在尝试在表格中添加序列号。这是我的方法: 为什么此方法给我一个错误,而我的结果集已设置为可更新。我正在使用derby数据库。 问题答案: 根据Derby文档,带有的查询不可更新: 只有简单的单表SELECT游标才可以更新。可更新ResultSet的SELECT语句与可更新游标的SELECT语句具有相同的语法。生成可更新的游标: 该语句不能包含子句。 基础查询必须是SelectExp

  • 我正在测试一个用Java和spring boot写的应用程序,我有一个问题。我的测试模拟一个HTTP请求,该请求只有在数据放置在头中时才有效。这是我的简单测试的代码: 不幸的是这次测试失败了。用于测试的Java代码如下: 在实际操作中,似乎找不到应该从请求头中取出的字符串!因此,测试只评估else分支,实际上在stacktrace中也告诉我,测试希望状态已创建,但状态302已给出。既然应用程序(没