菜鸟请教一个关于ssh连接不通的问题

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
jinpaishashou
帖子: 3
注册时间: 2015-01-08 22:23
系统: ubuntu14

菜鸟请教一个关于ssh连接不通的问题

#1

帖子 jinpaishashou » 2015-01-09 10:10

大家好,我的系统是Ubuntu14. 刚学会用ssh连接远程电脑进行一些简单工作。
我的情况是这样的。家里的网口都是插线线能直接上网的。PC用网线直接插家里的网口,ssh连接(已经设置成无密匙连接)没有问题。但是如果是通过家里的无线路由器的无线网络,ssh显示connection被远程电脑closed。我不懂事怎么回事,怀疑是无线路由器的设置问题,但不知道具体是怎么回事。用一家咖啡店的无线网络(没有密码的),ssh可以连通。
希望大牛能提供一些帮助,谢谢。
头像
astolia
论坛版主
帖子: 6703
注册时间: 2008-09-18 13:11

Re: 菜鸟请教一个关于ssh连接不通的问题

#2

帖子 astolia » 2015-01-09 11:44

ssh带上-vvv参数看具体的连接过程
jinpaishashou
帖子: 3
注册时间: 2015-01-08 22:23
系统: ubuntu14

Re: 菜鸟请教一个关于ssh连接不通的问题

#3

帖子 jinpaishashou » 2015-01-09 13:02

astolia 写了:ssh带上-vvv参数看具体的连接过程
直接ssh xx@xxx.xx.xxx,过了一会儿显示的是Connection closed by xxx.xx.xxx
加上-vvv后,显示如下:
OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to 119.78.133.62 [119.78.133.62] port 22.
debug1: Connection established.
debug3: Incorrect RSA1 identifier
debug3: Could not load "/home/ray/.ssh/id_rsa" as a RSA1 public key
debug1: identity file /home/ray/.ssh/id_rsa type 1
debug1: identity file /home/ray/.ssh/id_rsa-cert type -1
debug3: Incorrect RSA1 identifier
debug3: Could not load "/home/ray/.ssh/id_dsa" as a RSA1 public key
debug1: identity file /home/ray/.ssh/id_dsa type 2
debug1: identity file /home/ray/.ssh/id_dsa-cert type -1
debug1: identity file /home/ray/.ssh/id_ecdsa type -1
debug1: identity file /home/ray/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/ray/.ssh/id_ed25519 type -1
debug1: identity file /home/ray/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
debug1: Remote protocol version 2.0, remote software version OpenSSH_4.3
debug1: match: OpenSSH_4.3 pat OpenSSH_4* compat 0x00000000
debug2: fd 3 setting O_NONBLOCK
debug3: load_hostkeys: loading entries for host "119.78.133.62" from file "/home/ray/.ssh/known_hosts"
debug3: load_hostkeys: found key type RSA in file /home/ray/.ssh/known_hosts:2
debug3: load_hostkeys: loaded 1 keys
debug3: order_hostkeyalgs: prefer hostkeyalgs: ssh-rsa-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-rsa
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-rsa,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,ssh-dss-cert-v00@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,ssh-dss
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: mac_setup: setup hmac-md5
debug1: kex: server->client aes128-ctr hmac-md5 none
debug2: mac_setup: setup hmac-md5
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<3072<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
^C
ray@ray-ThinkPad-T440s:~$ ^C
是什么问题?
taohunter
帖子: 1555
注册时间: 2012-03-31 3:29

Re: 菜鸟请教一个关于ssh连接不通的问题

#4

帖子 taohunter » 2015-01-09 23:54

楼主家中的路由器是哪个厂商的,什么型号?

某些路由器厂商的特定版本的firmware会导致ubuntu ssh连接有问题,例如:
https://bugs.launchpad.net/ubuntu/+sour ... ug/1287222

如果有可用的更高版本的路由器firmware,可以考虑升级一下试试。
三年后终于回到16.04--稳定了!
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 菜鸟请教一个关于ssh连接不通的问题

#5

帖子 poloshiao » 2015-01-10 8:48

http://askubuntu.com/questions/229640/c ... st-for-ssh
判讀 OpenSSH Server 的 Log File 可能會有幫助
回复