V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
esolve
V2EX  ›  问与答

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

  •  
  •   esolve · 2017-03-23 16:36:46 +08:00 · 1469 次点击
    这是一个创建于 2562 天前的主题,其中的信息可能已经有所发展或是发生改变。

    我新开的 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 条回复    2017-03-23 18:25:23 +08:00
    chongdianbao
        1
    chongdianbao  
       2017-03-23 16:41:10 +08:00 via Android
    挂个代理再连
    esolve
        2
    esolve  
    OP
       2017-03-23 16:44:49 +08:00
    @chongdianbao 挂了代理也不能连啊
    而且不挂代理也能 ping 通啊
    难道封了 22 号端口?
    akira
        3
    akira  
       2017-03-23 16:56:24 +08:00
    海外的服务器,都有一定几率被 gfw 封了 ip 的。不过你的问题更大可能是别的原因了啦
    SpicyCat
        4
    SpicyCat  
       2017-03-23 17:14:27 +08:00
    ssh -i your.pem ubuntu@<your-ip>

    1. 用 ip 连
    2. AWS 创建的 ubuntu instance 默认没有开放 root 用户,使用 ubuntu 用户
    cxbig
        5
    cxbig  
       2017-03-23 17:38:41 +08:00
    4 楼说的第二点是关键,默认用户是 ubuntu 而不是 root
    knightdf
        6
    knightdf  
       2017-03-23 17:47:50 +08:00
    aws 默认不能用 root 登录的,试试 ubuntu 或者 ec2-user
    imherer
        7
    imherer  
       2017-03-23 18:25:23 +08:00
    1.用户名试试 ubuntu 或 ec2-user
    2.后面的 dns 换成 ip
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5401 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 08:33 · PVG 16:33 · LAX 01:33 · JFK 04:33
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.