免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1638 | 回复: 2
打印 上一主题 下一主题

[系统管理] SSH登录很慢 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2015-07-08 15:18 |只看该作者 |倒序浏览
本帖最后由 jiakon 于 2015-07-08 15:18 编辑

操作系统:CentOS 6.5
test@intranet可以无密码登录192.168.2.5
出现问题是连接192.168.2.5到了Last login: Wed Jul  8 15:11:26 2015 from 192.168.0.8之后就会卡住5-10秒,然后才登录成功


test@intranet:~$ssh -vvvv root@192.168.2.5
OpenSSH_5.6p1, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
debug1: Reading configuration data /usr/local/openssh/etc/ssh_config
host: 192.168.2.5, port: 22
debug2: ssh_connect: needpriv 0
debug1: Connecting to 192.168.2.5 [192.168.2.5] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 532/532
debug1: identity file /home/test/.ssh/id_rsa type -1
debug1: identity file /home/test/.ssh/id_rsa-cert type -1
debug1: identity file /home/test/.ssh/id_dsa type -1
debug1: identity file /home/test/.ssh/id_dsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.6
debug2: fd 3 setting O_NONBLOCK
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: 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-dss-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-dss-cert-v00@openssh.com,ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,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-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,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-sha256,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-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,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-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,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: found hmac-md5
debug1: kex: server->client aes128-ctr hmac-md5 none
debug2: mac_setup: found hmac-md5
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug2: dh_gen_key: priv key bits set: 127/256
debug2: bits set: 524/1024
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug3: check_host_in_hostfile: host 192.168.2.5 filename /home/test/.ssh/known_hosts
debug3: check_host_in_hostfile: host 192.168.2.5 filename /home/test/.ssh/known_hosts
debug3: check_host_in_hostfile: match line 2
debug1: Host '192.168.2.5' is known and matches the RSA host key.
debug1: Found key in /home/test/.ssh/known_hosts:2
debug2: bits set: 492/1024
debug1: ssh_rsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /home/test/.ssh/id_rsa ((nil))
debug2: key: /home/test/.ssh/id_dsa ((nil))
debug1: Authentications that can continue: publickey,password
debug3: start over, passed a different list publickey,password
debug3: preferred password
debug3: authmethod_lookup password
debug3: remaining preferred:
debug3: authmethod_is_enabled password
debug1: Next authentication method: password
Get password suc.
debug3: packet_send2: adding 64 (len 59 padlen 5 extra_pad 64)
debug2: we sent a password packet, wait for reply
debug1: Authentication succeeded (password).
Authenticated to 192.168.2.5 ([192.168.2.5]:22).
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug2: callback start
debug2: client_session2_setup: id 0
debug2: channel 0: request pty-req confirm 1
debug2: channel 0: request shell confirm 1
debug2: fd 3 setting TCP_NODELAY
debug2: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug2: channel_input_status_confirm: type 99 id 0
debug2: PTY allocation request accepted on channel 0
debug2: channel 0: rcvd adjust 2097152
debug2: channel_input_status_confirm: type 99 id 0
debug2: shell request accepted on channel 0
Last login: Wed Jul  8 15:11:26 2015 from 192.168.0.8——出现这一行后开始卡住
[root@dn1 ~]#

论坛徽章:
0
2 [报告]
发表于 2015-07-08 16:23 |只看该作者
starce的结果,每次都卡在某一步:

16:22:40 getsockopt(3, SOL_TCP, TCP_NODELAY, [545776745731588096], [4]) = 0
16:22:40 setsockopt(3, SOL_TCP, TCP_NODELAY, [1], 4) = 0
16:22:40 getsockname(3, {sa_family=AF_INET, sin_port=htons(51333), sin_addr=inet_addr("172.16.0.8"}, [16]) = 0
16:22:40 setsockopt(3, SOL_IP, IP_TOS, [16], 4) = 0
16:22:40 select(8, [3], [3], NULL, NULL) = 1 (out [3])
16:22:40 write(3, "\x02\xca\x53\xdd\xec\x13\xd9\x7e\x7a\x65\x84\xcb\xdd\x92\xc9\x8a\xc3\xbc\x98\x97\x0f\xcf\x58\xf2\x1c\x15\x46\x9d\x1b\x52\xf9\xf6"..., 38416:22:40 write(3, "\x02\xca\x53\xdd\xec\x13\xd9\x7e\x7a\x65\x84\xcb\xdd\x92\xc9\x8a\xc3\xbc\x98\x97\x0f\xcf\x58\xf2\x1c\x15\x46\x9d\x1b\x52\xf9\xf6"..., 384) = 384
16:22:40 select(8, [3], [], NULL, NULL) = 1 (in [3])
16:22:40 read(3, "\x2f\x7d\xc0\x25\x8f\xd9\x18\x91\xe0\x98\x97\x03\xc8\x04\xea\xd2\x56\x21\xf3\xb9\x5b\xe1\x95\x48\x0b\xac\xe2\xf0\x86\xa7\x76\xbc"..., 8192) = 112
16:22:40 select(8, [3 5], [], NULL, NULL) = 1 (in [3])
16:22:40 read(3, "\xc4\x39\x02\x1b\x59\xb1\x8b\xf5\x4e\x53\xd5\x65\x30\x97\xc0\x55\xab\x99\x91\xdc\x57\xb3\x01\x9d\xf7\x1c\x56\x74\xdd\xef\xb9\x14"..., 8192) = 96
16:22:40 select(8, [3 5], [6], NULL, NULL) = 1 (out [6])
16:22:40 write(6, "Last login: Wed Jul  8 16:21:52 "..., 57) = 57
16:22:40 open("/etc/localtime", O_RDONLY) = 8
16:22:40 fstat(8, {st_mode=S_IFREG|0644, st_size=388, ...}) = 0
16:22:40 fstat(8, {st_mode=S_IFREG|0644, st_size=388, ...}) = 0
16:22:40 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3140efe000
16:22:40 read(8, "\x54\x5a\x69\x66\x32\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x00"..., 4096) = 388
16:22:40 lseek(8, -240, SEEK_CUR)       = 148
16:22:40 read(8, "\x54\x5a\x69\x66\x32\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x03\x00\x00\x00\x00"..., 4096) = 240
16:22:40 close(                       = 0
16:22:40 munmap(0x7f3140efe000, 4096)   = 0
16:22:40 select(8, [3 5], [], NULL, NULL) = 1 (in [3])
16:22:43 read(3, "\xdd\xcf\x60\x74\x60\x91\x38\x6b\xf5\xb5\x77\x95\xc4\x5f\xde\x9a\xcf\x8b\x8e\x10\x4c\xe6\xa9\x25\xcc\x6a\x6d\x91\xc0\x69\xee\x9b"..., 8192) = 80
16:22:43 select(8, [3 5], [6], NULL, NULL) = 1 (out [6])
16:22:43 write(6, "\x1b\x5d\x30\x3b\x72\x6f\x6f\x74\x40\x64\x6e\x31\x3a\x7e\x07\x1b\x5b\x3f\x31\x30\x33\x34\x68\x5b\x72\x6f\x6f\x74\x40\x64\x6e\x31"..., 37) = 37
16:22:43 stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=388, ...}) = 0

论坛徽章:
0
3 [报告]
发表于 2015-07-08 18:27 |只看该作者
把/etc/ssh/sshd_config里的 useDNS=yes 改为no,并且去掉前面的注释。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP