如何查找AWS密钥对公钥?(How to find AWS keypair public key?)

编程入门 行业动态 更新时间:2024-10-24 10:18:20
如何查找AWS密钥对公钥?(How to find AWS keypair public key?)

因此,我们团队中的开发人员似乎删除了我们的.ssh/authorized_keys App-Production.pem密钥的.ssh/authorized_keys ,因此默认的AWS Key Pair不再有效,从而破坏了我们的部署管道。

在哪里可以找到要添加回authorized_keys公钥? 是否可以在不必启动新实例的情况下执行此操作?

So, it seems a developer on our team deleted the public key for our App-Production.pem key in our .ssh/authorized_keys, so the default AWS Key Pair no longer works, breaking our deployment pipeline.

Where can I find the public key to add back to authorized_keys? Is it possible to do this without having to boot a fresh instance?

最满意答案

如果您有私钥,则可以检索公钥。

如果您使用的是Linux,请使用以下命令:

ssh-keygen -y

然后在提示时提供私钥文件的路径。 之后,您将获得一个公钥。 保存。

然后使用以下步骤重新获得对此实例的访问权限。

停止你的实例 分离根卷 将卷附加到另一个实例作为数据卷 使用公钥修改authorized_keys文件 分离数据卷 将卷重新附加到受影响的实例

有关更多信息,请参阅此文档 。

If you have the private key, you can retrieve the public key.

If you are using Linux, use following command,

ssh-keygen -y

Then provide your path to private key file when prompted. After that you will be given a public key. Save it.

Then use following steps to regain access to this instance.

Stop your instance Detach root volume Attach volume to another instance as a data volume Modify the authorized_keys file with the public key Detach the data volume Re attach the volume to the affected instance

For more information follow this doc.

更多推荐

本文发布于:2023-08-06 08:07:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1446653.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:密钥   公钥   AWS   find   key

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!