简体   繁体   English

带有密钥对的AWS EC2 ssh连接

[英]AWS EC2 ssh connection with key pair

I am beginning using AWS. 我开始使用AWS。 Previously, I have created AWS "Amazon AMI" type instance. 以前,我创建了AWS“ Amazon AMI”类型实例。 I could connect using putty without an issue using a key-pair I have created before hand. 我可以使用腻子进行连接,而不会使用之前创建的密钥对产生任何问题。

I am now trying to do the same using a "Ubuntu AMI". 我现在正在尝试使用“ Ubuntu AMI”执行相同的操作。 However, proceeding the exact same way, putty throws me "the server refused our key" error. 但是,以完全相同的方式进行操作,腻子会向我抛出“服务器拒绝我们的密钥”错误。

I thought I understand key-pair is not AMI-specific. 我以为我知道密钥对不是特定于AMI的。 What could be wrong then ? 那可能是什么问题呢?

The key pair is not AMI specific. 密钥对不是特定于AMI的。 But the AMI is key specific. 但是AMI是特定于密钥的。

This means that you can create "n" no. 这意味着您可以创建“ n”号。 of instances with "n" key-pairs. 具有“ n”个密钥对的实例。

Also you can use a single key-pair for all "n" instances but you need to select that at the booting time. 同样,您可以对所有“ n”个实例使用单个密钥对,但是您需要在启动时进行选择。

Also the username is AMI specific ie 另外,用户名是AMI特定的,即

ubuntu for all ubuntu ubuntu适用于所有ubuntu

ec2-user for all RHEL. 所有RHEL的ec2-user。

Please check the AMI specific username for the newly created AMI 请检查新创建的AMI的AMI特定用户名

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM