【问题标题】:unable to connect to aws machine : operation timed out无法连接到 aws 机器:操作超时
【发布时间】:2012-05-11 06:45:23
【问题描述】:

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

@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 但没有运气

我该如何解决这个问题?

【问题讨论】:

    标签: amazon-ec2 amazon-web-services


    【解决方案1】:

    这个问题已经解决了。

    原因

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

    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

    它就像一个魅力:)

    【讨论】:

    • 叹息,我已经使用 AWS 几个星期了,我完全忘记了安全组的事情
    • 谢谢,安全组是我的问题。
    猜你喜欢
    • 2020-08-10
    • 2018-12-01
    • 2020-07-05
    • 2018-07-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-12-14
    • 1970-01-01
    相关资源
    最近更新 更多