Linux Amazon EC2 私钥丢失,如何访问服务器?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10369547/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 06:04:07  来源:igfitidea点击:

Amazon EC2 lost private key, how to get access to the server?

linuxubuntusshamazon-ec2private-key

提问by Jason

My computer was stolen the day before yesterday, and I put one of my servers private key in that, the key is password protected, so it should be OK. But the problem is that now I can not access the server.

The server is Ubuntu, Amazon EC2, Root Device: Instance Store.I've been searching this for a whole day, looks like if the server is EBS, then it will be easier to just create an image and launch a new instance. But unfortunately mine is not.

I really hope that some one can give me an advise on how to get access to the server, my user type is root, so no one else can modify the key for me.

I don't know if you can create private key from the public key, and I don't know if you can actually get the public key from Amazon EC2. Please help.

Thank you very much!

我的电脑前天被盗了,我把我的一个服务器私钥放在里面,这个密钥是有密码保护的,所以应该没问题。但问题是现在我无法访问服务器。

服务器是 Ubuntu,Amazon EC2,根设备:实例存储。我已经搜索了一整天,看起来如果服务器是EBS,那么创建一个图像并启动一个新实例会更容易。但不幸的是,我的不是。

我真的希望有人能给我一个关于如何访问服务器的建议,我的用户类型是root,所以没有人可以为我修改密钥。

我不知道您是否可以从公钥创建私钥,也不知道您是否真的可以从 Amazon EC2 中获取公钥。请帮忙。

非常感谢!

采纳答案by Kjuly

Try to do like this:

尝试这样做:

Login to your AWS Management Console, in EC2tab view, you'll find something like 1 key Pair, click it, delete your old key pair, then create new pair.

登录您的AWS 管理控制台,在EC2选项卡视图中,您会找到类似的内容1 key Pair,单击它,删除旧密钥对,然后创建新密钥对。



EDIT:

编辑:

Got a related question HERE

这里有一个相关的问题

What you could do, is assign one of your Elastic IP's to the instance and route traffic through that normally. Snapshot the instance and bring up a duplicate with a new Keypair. Switch the Elastic IP over to the new instance.

您可以做的是将您的弹性 IP 之一分配给实例并通过该实例正常路由流量。对实例进行快照并使用新的密钥对调出副本。将弹性 IP 切换到新实例。

and HERE

这里

The best solution we have been able to come up with is to burn an AMI from the running instance and launch a new instance from that AMI using the new key pair.

我们能够提出的最佳解决方案是从正在运行的实例中烧录一个 AMI,然后使用新的密钥对从该 AMI 启动一个新实例。

How to create your own AMI? HERE. ;)

如何创建自己的 AMI?在这里。;)