esolve
V2EX  ›  问与答

AWS 的 instance 用 ssh 登不上去怎么回事?

  •  
  •   esolve · Mar 23, 2017 · 1919 views
    This topic created in 3344 days ago, the information mentioned may be changed or developed.

    我新开的 aws 账户 创建了一个 ubuntu instance

    security group inbound 规则如下

    SSH TCP 22 0.0.0.0/0 SSH TCP 22 ::/0 All ICMP - IPv4 All N/A 0.0.0.0/0 All ICMP - IPv4 All N/A ::/0

    然后 ping 了 public DNS 可以 ping 通 不过延迟将近 400ms 我下载了 pem 文件 然后 ssh -i my.pem root@ec2-35-162-209-225.us-west-2.compute.amazonaws.com 或者 ssh -i my.pem ubuntu@ec2-35-162-209-225.us-west-2.compute.amazonaws.com (因为隐私, 上面的 public DNS 我改了些数字) 但是 ssh 就停在那里,登陆不上去 怎么回事啊

    BTW,我觉得 ec2-35-162-209-225.us-west-2.compute.amazonaws.com 是主机地址啊,为何叫做 public DNS ?

    7 replies    2017-03-23 18:25:23 +08:00
    chongdianbao
        1
    chongdianbao  
       Mar 23, 2017 via Android
    挂个代理再连
    esolve
        2
    esolve  
    OP
       Mar 23, 2017
    @chongdianbao 挂了代理也不能连啊
    而且不挂代理也能 ping 通啊
    难道封了 22 号端口?
    akira
        3
    akira  
       Mar 23, 2017
    海外的服务器,都有一定几率被 gfw 封了 ip 的。不过你的问题更大可能是别的原因了啦
    SpicyCat
        4
    SpicyCat  
       Mar 23, 2017
    ssh -i your.pem ubuntu@<your-ip>

    1. 用 ip 连
    2. AWS 创建的 ubuntu instance 默认没有开放 root 用户,使用 ubuntu 用户
    cxbig
        5
    cxbig  
       Mar 23, 2017
    4 楼说的第二点是关键,默认用户是 ubuntu 而不是 root
    knightdf
        6
    knightdf  
       Mar 23, 2017
    aws 默认不能用 root 登录的,试试 ubuntu 或者 ec2-user
    imherer
        7
    imherer  
       Mar 23, 2017
    1.用户名试试 ubuntu 或 ec2-user
    2.后面的 dns 换成 ip
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3825 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 70ms · UTC 00:52 · PVG 08:52 · LAX 17:52 · JFK 20:52
    ♥ Do have faith in what you're doing.