amazon-ec2 - 无法连接到AWS机器: operation timed out

标签 amazon-ec2 amazon-web-services

我是AWS新手并正确创建了 key 对

@air~/.ec2 - 14:25:10$ ec2-add-keypair mykey > mykey.pem  

并使用相同的键运行实例
@air~/.ec2 - 14:25:15$ec2-run-instances ami-a29243cb -k mykey -t t1.micro  

当尝试连接到机器时,我看到
@air~/.ec2 - 14:25:22$ ssh  -v -i mykey.pem ec2-user@ec2-21-20-42-115.compute-1.amazonaws.com
OpenSSH_5.6p1, OpenSSL 0.9.8r 8 Feb 2011
debug1: Reading configuration data /etc/ssh_config
debug1: Applying options for *
debug1: Connecting to ec2-user@ec2-21-20-42-115.compute-1.amazonaws.com [21.20.42.185] port 22.
ssh: connect to host ec2-user@ec2-21-20-42-115.compute-1.amazonaws.com port 22: Operation timed out

我什至尝试过root@ec2-21-20-42-115.compute-1.amazonaws.com但没有运气

我怎样才能解决这个问题?

最佳答案

此问题已解决。

的原因

  • 安全组是默认设置,而不是我创建的默认设置。使用命令
  • 修复

    ec2-run-instances ami-a29243cb -k mykey -t t1.micro -g worker


  • 以ubuntu身份登录,而不是ec2-user
  • 登录

    ssh -v -i ~/.ec2/mykey.pem ubuntu@ec2-13-24-2-39.compute-1.amazonaws.com



    它就像一个魅力:)

    关于amazon-ec2 - 无法连接到AWS机器: operation timed out,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10542607/

    相关文章:

    amazon-s3 - SimpleDB 和 S3 之间的区别

    amazon-web-services - AWS : security groups ignoring traffic from elastic IP

    amazon-web-services - 使用 IAM 角色真的比将加密凭证存储在磁盘上更安全吗?

    amazon-web-services - AWS X-Ray、Dotnet Core 3.1、本地 X-Ray 守护程序

    amazon-web-services - 设置 CloudWatch 日志的合理方法 (awslogs-agent)

    amazon-ec2 - 如何使用CloudFormation编辑VPC的默认网络ACL?

    postgresql - 在 Amazon EC2/Google Compute Engine 中设置 XNAT

    linux - 默认 bash 环境已更改。我如何将其恢复为默认值?

    amazon-ec2 - 如何在 Spark 中打开 Commoncrawl.org WARC.GZ S3 数据

    amazon-web-services - 我们可以将 AWS Glue 视为 EMR 的替代品吗?