V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
dhq314
V2EX  ›  Linux

ssh连接超时,出现“Operation timed out”的错误

  •  
  •   dhq314 ·
    dhq314 · 2012-12-29 10:29:54 +08:00 · 30875 次点击
    这是一个创建于 4126 天前的主题,其中的信息可能已经有所发展或是发生改变。
    不知道什么原因,白天在公司连还连得好好的,晚上回到家里连,就出现了以下的错误:

    ssh -vvv root@IP地址
    OpenSSH_5.9p1, OpenSSL 0.9.8r 8 Feb 2011
    debug1: Reading configuration data /etc/ssh_config
    debug1: /etc/ssh_config line 20: Applying options for *
    debug2: ssh_connect: needpriv 0
    debug1: Connecting to IP地址 [IP地址] port 22.
    debug1: connect to address IP地址 port 22: Operation timed out
    ssh: connect to host IP地址 port 22: Operation timed out

    可以连接其他的ssh,也可以通过先连到其他的ssh服务器上面,再在那台服务器上连这个ssh
    8 条回复    1970-01-01 08:00:00 +08:00
    ultragtx
        1
    ultragtx  
       2012-12-29 10:33:25 +08:00
    目测墙了
    dhq314
        2
    dhq314  
    OP
       2012-12-29 10:46:53 +08:00
    唉,今天用公司的电脑连,也连不了了。

    不过觉得奇怪的是,我可以先ssh到其他服务器,再在服务器上ssh到那台服务器上,而且挂在那台服务器上的网站、VPN还可以访问。

    我用的是linode,是不是可以申请换IP的?
    luin
        3
    luin  
       2012-12-29 11:18:28 +08:00 via iPhone
    换个ssh端口试试
    TONYHEAD
        4
    TONYHEAD  
       2012-12-29 11:52:32 +08:00
    应该是被墙了。
    micate
        5
    micate  
       2012-12-29 13:08:19 +08:00
    怎么说,应该说是端口被封还是什么呢?
    micate
        6
    micate  
       2012-12-29 13:09:34 +08:00
    ... ctrl + enter 提交好不习惯
    换个端口立马解决问题,我的 linode 前几天也遇到过。
    lucky9805
        7
    lucky9805  
       2012-12-29 14:02:14 +08:00   ❤️ 4
    第一步:
    先使用Lish with SSH : 登陆到ssh上。

    第二步:
    修改 ssh_config
    vim /etc/ssh/ssh_config

    在里面增加 Port 1433

    第三步:
    /usr/sbin/sshd -p 1433

    第四步:重启SSHD
    /etc/init.d/shhd restrat

    如果你启动了iptables,则需要继续做如下操作:
    第五步:
    修改iptables
    vim /etc/sysconfig/iptables

    增加 -A INPUT -m state --state NEW -m tcp -p tcp --dport 1433 -j ACCEPT

    第六步:
    重启iptables:
    service iptables restart

    ~~~~~~
    现在 使用你的终端:
    ssh -p1433 root@linodeIP

    应该可以继续了...
    dhq314
        8
    dhq314  
    OP
       2012-12-29 15:34:41 +08:00
    换个端口之后可以登陆了,多谢 @lucky9805 和楼上各位朋友了:)
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1261 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 18:02 · PVG 02:02 · LAX 11:02 · JFK 14:02
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.