简体   繁体   English

如何与 AWS EC2 实例建立连接并找到托管文件

[英]How to make connection with AWS EC2 instance and locate the hosted files

I am using a AWS console which show a running instance but when I check the storage in S3 there are no files in it.我正在使用显示正在运行的实例的 AWS 控制台,但是当我检查 S3 中的存储时,其中没有文件。 I have checked all the other storage options but unable to find any files.我检查了所有其他存储选项,但找不到任何文件。 I need to check that which website is hosted on this instance.我需要检查这个实例上托管了哪个网站。 What can i do?我能做什么?

Moreover, I do not have.pem of the instance而且,我没有实例的.pem

I am working on a client website and we have a doubt that one of our website is hosted on AWS.我在一个客户网站上工作,我们怀疑我们的一个网站托管在 AWS 上。 We want to migrate that website from AWS to another host.我们想将该网站从 AWS 迁移到另一台主机。

Please guide what is the best way to do this?请指导执行此操作的最佳方法是什么?

Thanks谢谢

Amazon EC2 uses Elastic Block Store (EBS) volumes for its file system, not S3. Amazon EC2 的文件系统使用弹性块存储 (EBS) 卷,而不是 S3。 So if the web site is hosted by an EC2 instance, the files will most likely be stored on an EBS volume.因此,如果 web 站点由 EC2 实例托管,则文件很可能存储在 EBS 卷上。 To get access, you will probably need to log in to the instance using SSH or the AWS Session Manager .要获得访问权限,您可能需要使用 SSH 或AWS Session Manager登录实例。 Alternatively, you can try and attach the volume to a different EC2 instance that you have access to.或者,您可以尝试将该卷附加到您有权访问的其他 EC2 实例

Firstly S3 is for object storage, the instance runs off block storage using EBS and is where the file structure is located.首先,S3 用于 object 存储,该实例使用 EBS 从块存储运行,并且是文件结构所在的位置。 Unless a job exists to manually copy content to S3 you will not find it there.除非存在手动将内容复制到 S3 的工作,否则您不会在那里找到它。

There are a few options you can perform to gain access:您可以执行几个选项来获得访问权限:

  • You can try connecting using Sessions Manager assuming that the SSM Agent is running on the host.假设SSM 代理正在主机上运行,您可以尝试使用会话管理器进行连接。
  • You can try using instance connect if it is setup, this will allow you to use an SSH terminal by specifying a temporary pem .如果已设置,您可以尝试使用实例连接,这将允许您通过指定临时 pem 来使用 SSH 终端
  • You can create an AMI of the server and then launch a new instance from this AMI (the server will be running as if it is the server that you took the AMI from so be aware services will be running).您可以创建服务器的 AMI,然后从此 AMI 启动一个新实例(服务器将像您从中获取 AMI 的服务器一样运行,因此请注意服务将运行)。
  • You can take a EBS snapshot of the server and attempt to launch a new volume from this.您可以拍摄服务器的 EBS 快照并尝试从中启动新卷。 You would then mount it to a host.然后你可以将它挂载到主机上。

Be aware that if this is a Windows host, connecting via regular RDP will require the Windows password of the host.请注意,如果这是一台 Windows 主机,通过常规 RDP 连接将需要主机的 Windows 密码。 If this is the case you will need to follow these instructions .如果是这种情况,您将需要按照这些说明进行操作。

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

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