简体   繁体   English

如何从 Linux 机器上的 web 浏览器访问 AWS EC2 实例?

[英]How to access AWS EC2 instance from web browser on Linux machine?

When I try to connect to my EC2 instance using web browser (Mozilla Firefox) using the third option in the connect (EC2 Instance Connect (browser-based SSH connection) ), I get the following error in the new pop-up window:当我尝试使用连接中的第三个选项(EC2 Instance Connect (browser-based SSH connection))使用 web 浏览器(Mozilla Firefox)连接到我的 EC2 实例时,我在新的弹出窗口中收到以下错误 Z045B8C742CBD902FFBF23

There was a problem setting up the instance connection设置实例连接时出现问题
Log in failed.登录失败。 If this instance has just started up, try again in a minute or two.如果此实例刚刚启动,请在一两分钟后重试。

Some things to check:需要检查的一些事项:

  • Make sure the instance was launched from Amazon Linux 2 or Ubuntu 16.04 or later确保实例是从Amazon Linux 2Ubuntu 16.04 or later启动的
  • Check that the instance is in a public subnet (defined as having a Route Table that points to an Internet Gateway)检查实例是否在公共子网中(定义为具有指向 Internet 网关的路由表)
  • Open the Security Group for SSH (port 22) either for the whole Internet ( 0.0.0.0/0 ) (which is a very poor choice for security) or from the IP address ranges for EC2 Instance Connect (See: AWS IP Address Ranges - AWS General Reference ) Open the Security Group for SSH (port 22) either for the whole Internet ( 0.0.0.0/0 ) (which is a very poor choice for security) or from the IP address ranges for EC2 Instance Connect (See: AWS IP Address Ranges - AWS 一般参考

EC2 Instance Connect in your browser establishes a web connection to the AWS service.浏览器中的 EC2 Instance Connect 与 AWS 服务建立 web 连接。 Then, the SSH connection is established from the AWS Service to the Amazon EC2 instance.然后,建立从 AWS 服务到 Amazon EC2 实例的 SSH 连接。 This is why the security group needs to allow incoming connections from the IP address range associated with the EC2 Instance Connect Service (not your own IP address).这就是为什么安全组需要允许来自与 EC2 实例连接服务关联的 IP 地址范围的传入连接(不是您自己的 IP 地址)。

Alternative ways to connect are:替代的连接方式是:

  • Run an SSH client on your computer, or在您的计算机上运行 SSH 客户端,或
  • Use AWS Systems Manager Session Manager (which connects via an Agent running on the computer, so it's not 'real' SSH)使用 AWS Systems Manager Session 管理器(通过计算机上运行的代理连接,因此它不是“真正的”SSH)

暂无
暂无

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

相关问题 如何从我的AWS linux EC2实例调用浏览器 - How to invoke browser from my AWS linux EC2 instance 将文件从 linux 机器复制到 aws ec2 实例 - Copying files from a linux machine to an aws ec2 instance AWS EC2 (AWS Linux) 我如何访问私有实例 - AWS EC2 (AWS Linux) how I access a private instance 如何从公司内部机器浏览器访问 AWS EC2 实例私有 IP 以访问在 EC2 上运行的应用程序 - How to hit an AWS EC2 instance private IP from company on premise machine brwoser to access application running on the EC2 如何从 AWS EC2 实例 ping 到我的本地机器? - How to ping to my local machine from AWS EC2 instance? 如何从我的家用计算机访问在Amazon EC2实例中的Web服务器中部署的应用程序? - How to access the application deployed in a web server in an amazon ec2 instance from my home machine? 如何从另一台机器访问 ec2 实例的特定端口? - How to access a specific port of the ec2 instance from another machine? 如何从 AWS ec2 实例中卸载 apache web 服务器? - how to uninstall apache web server from AWS ec2 instance? 是否可以将文件或文件夹从 AWS Linux EC2 实例下载到本地 Windows 10 机器? - Is it possible to download file or folders from AWS Linux EC2 instance to local Windows 10 machine? 如何从本地浏览器访问在 jenkins docker 实例中运行的 AWS EC2 docker tomcat 实例 - How to Access AWS EC2 docker tomcat instance running inside jenkins docker instance from my local browser
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM