[英]Troubleshooting ssh login failure for AWS EC2 using powershell
Short problem description: I had created two new AWS EC2 server instances on Redhat Linux and Ubuntu operating system.简短的问题描述:我在 Redhat Linux 和 Ubuntu 操作系统上创建了两个新的 AWS EC2 服务器实例。 I was trying to login to it through SSH via Putty but was getting errors(detailed errors further in question).
我试图通过 Putty 通过 SSH 登录它,但出现错误(详细错误有问题)。 This is just a short description.
这只是一个简短的描述。
Detailed problem description: I generated a new .pem file after creating a free tier Amazon EC2(Elastic Compute Cloud) server of Ubuntu 20 OS version.详细问题描述:我在创建Ubuntu 20 OS版本的免费层Amazon EC2(弹性计算云)服务器后生成了一个新的.pem文件。 Then I have used
PuttyGen
software in my Windows-10 OS pc While trying to login through putty it was giving me an error as shown in the following error description, due to this I was not able to login to aws machines, I have further investigated the issue and all details of troubleshooting steps are mentioned in detailed manner in this self answered question(other suggestions/solutions are welcome).然后我在我的 Windows-10 操作系统电脑中使用了
PuttyGen
软件尝试通过 putty 登录时,它给了我一个错误,如下面的错误描述所示,因此我无法登录到 aws 机器,我进一步调查在这个自我回答的问题中详细提到了问题和故障排除步骤的所有细节(欢迎其他建议/解决方案)。
Error's description:错误描述:
"Server refused our key"
On terminal AND "NO supported authentication method available(server sent:public ke;gssapi-with-mic)"
"Server refused our key"
在终端和"NO supported authentication method available(server sent:public ke;gssapi-with-mic)"
Initial troubleshooting:初步故障排除:
Obviously nothing of above worked;显然以上都没有奏效; enough talks so coming now to actual solution now :)
足够的谈话所以现在现在来实际解决方案:)
ACTUAL FIX with complete steps:带有完整步骤的实际修复:
ssh
, hence I tried SSH with powershell as follows.ssh
,因此我尝试了SSH与powershell如下。PS E:\test> ssh -i "aws_key_generator.pem" ubuntu@singh_server_test.compute.amazonaws.com
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @
WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions for 'aws_key_generator.pem' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "aws_key_generator.pem": bad permission
"Right click on .pem file"-->"Properties"-->"Security"-->"Advance"
and disabled “Inheritance” from there."Right click on .pem file"-->"Properties"-->"Security"-->"Advance"
并禁用“继承”来删除继承那里。PuttyGen
to "authorized_keys" and saved it.PuttyGen
生成的PuttyGen
添加到“authorized_keys”并保存。 I have fixed issue with this work around fix and thought to share with all here;我已经解决了这项工作的问题,并想在这里与所有人分享; other solutions are welcomed too, cheers and Happy learning.
也欢迎其他解决方案,干杯和快乐学习。
It appears that you are logging into an Ubuntu server.您似乎正在登录 Ubuntu 服务器。
For that, the username should be ubuntu
, not ec2-user
.为此,用户名应该是
ubuntu
,而不是ec2-user
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.