在亚马逊上为EC2实例生成pem文件

问题描述:

对于我们的生产系统,我们正在运行Amazon EC2实例。
对此负责的同事(例如称他为Joe)已离开公司。

For our production systems we are running Amazon EC2 Instances. The colleague responsible (say call him Joe) for that has left the company.

现在,我们希望拥有 ssh 访问我们的实例。

Now we want to have ssh access to our instance.

他把私人和公钥文件都留给了我们。

He left us both his private and his public key file.

id_dsa
id_dsa.pub

在后端我们可以看到,键 joe已分配给运行中的实例,并且ssh访问是通过以下命令完成的:

In the backend we can see, that the key "joe" is assigned to the runnning instance and that ssh access is done by the following command:

ssh -i "joe.pem" ec2-user@11.22.11.123

我们如何生成一个 .pem 文件?或更笼统地说,要获得ssh访问权需要做什么?

How can we generate a .pem file? Or more generally speaking, what needs to be done in order to get ssh access?

我们需要来自Amazon的证书吗?如果是,怎么办?

Do we need Certificates from Amazon? If so, how?

用于创建新的Pem密钥:

For creating New Pem key:

转到 EC2仪表板 > 密钥对> 创建密钥对

这将下载 pem密钥文件您。

用于SSH访问:


  1. 您可以添加id_rsa.pub实例〜/ .ssh / auth * 文件。之后,您可以使用 ssh ubuntu @ ip

  2. ssh来使用它。您可以使用与该实例关联的pem密钥通过使用 ssh -i file.pem ubuntu @ ip

  1. You can add your id_rsa.pub to instance ~/.ssh/auth* file. After that, you can ssh to it by using ssh ubuntu@ip
  2. You can use the pem key which is associated with that instance by using ssh -i "file.pem" ubuntu@ip