【发布时间】:2021-12-25 08:25:04
【问题描述】:
当我运行$ git clone https://github.com/aliscie/autodox 时,响应此命令的时间太长,然后它显示fatal: unable to access 'https://github.com/<whatever>': Failed to connect to github.com port 443: Connection timed out。另外,当我尝试sudo yum install docker 时,我遇到了同样的问题,但错误消息不同
https://amazonlinux-2-repos-eu-west-1.s3.eu-west-1.amazonaws.com/2/extras/docker/stable/x86_64/9273ea3ff10ea479755a952f9b7816de5808a0
9ab6d2cf7c7f56ea422962d7ac/repodata/repomd.xml?instance_id=i-0baa228b430689a3b®ion=eu-west-1: [Errno 12] Timeout on https://amazon
linux-2-repos-eu-west-1.s3.eu-west-1.amazonaws.com/2/extras/docker/stable/x86_64/9273ea3ff10ea479755a952f9b7816de5808a09ab6d2cf7c7f56
ea422962d7ac/repodata/repomd.xml?instance_id=i-0baa228b430689a3b®ion=eu-west-1: (28, 'Connection timed out after 5000 milliseconds
')
Trying other mirror.
- 我试过了
-
aws configure但我没有提供AWS Access Key ID因为我没有 - 我尝试转发文章Troubleshoot EC2 instance internet gateway,但对我来说毫无用处
- 在
security groups中,我设置了入站和出站规则以允许任何地方的所有流量。
【问题讨论】:
-
从实例中,你可以访问一个网站,例如
curl google.com吗?这将测试实例是否具有 Internet 访问权限。 -
我运行了它,它花了太长时间然后它返回
curl: (28) Failed to connect to google.com port 80: Connection timed out -
@JohnRotenstein 你知道为什么当我运行
git clone...时它说端口80而它说443吗? -
HTTP 使用端口 80。HTTPS 使用端口 443。您可以登录到 EC2 实例的事实表明您的入站安全组规则很好。问题可能在于安全组出站规则或网络 ACL(如果您修改了它们)或实例操作系统中配置的防火墙。
-
@JohnRotenstein 非常感谢,我在 vpc 中检查了我的网络 ACls,并添加了新规则以允许所有流量
标签: linux amazon-web-services amazon-ec2 firewall