[英]Lost access to EC2 instance
I reformatted my macbook and completely forgot to copy my ~/.ssh
directory.我重新格式化了我的 macbook,完全忘记了复制我的
~/.ssh
目录。
I tried ssh'ing into my EC2 instance我尝试通过 ssh 进入我的 EC2 实例
$ ssh ec2-user@xx.xxx.xxx.xx -i xxx.pem -v
OpenSSH_8.1p1, LibreSSL 2.7.3
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 47: Applying options for *
debug1: Connecting to xx.xxx.xxx.xx [xx.xxx.xxx.xx] port 22.
debug1: connect to address xx.xxx.xxx.xx port 22: Operation timed out
ssh: connect to host xx.xxx.xxx.xx port 22: Operation timed out
But I presume it's not working because my PEM file is linked to the id_rsa file on my old laptop?但我认为它不起作用,因为我的 PEM 文件链接到旧笔记本电脑上的 id_rsa 文件?
I had the PEM file in my google drive.我的谷歌驱动器中有 PEM 文件。
I've tried我试过了
sudo chmod 400 xxx.pem
Any ideas how I can regain access to my EC2 insance?有什么想法可以让我重新获得对我的 EC2 实例的访问权限吗?
I would generate a new key pair as explain here , but it requires me to have access to the instance我会按照此处的说明生成一个新的密钥对,但这需要我能够访问该实例
Update: check @jordanm comment.更新:检查@jordanm 评论。 You have no connection to the instance, maybe there is no need to create a new one.
你没有连接到实例,也许没有必要创建一个新的。
As far as I know there is only way to create a new one.据我所知,只有一种方法可以创建一个新的。 You can keep data if you make an image of your existing instance.
如果您制作现有实例的映像,则可以保留数据。 You may have changed external IP if your instance has no elastic IP attached.
如果您的实例没有附加弹性 IP,则您可能已经更改了外部 IP。
Actions -> Image and templates -> Create image
. Actions -> Image and templates -> Create image
。 Fill the form to create an image.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.