ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 【HPUX】HP-UX 11i 因特网和网络处理 - SSH 登录系统慢

【HPUX】HP-UX 11i 因特网和网络处理 - SSH 登录系统慢

Linux操作系统 作者:xysoul_云龙 时间:2015-06-09 11:50:42 0 删除 编辑
问题
从其他主机ssh一台hpux主机时,较SSH登录其他主机平均延迟2分钟左右。SSH主机自己,情况一样。检查DNS的配置情况,和其他主机并无区别。
debug SSH登录的信息如下: 
#ssh -v 127.0.0.1 
OpenSSH_5.0p1+sftpfilecontrol-v1.2-hpn13v1, OpenSSL 0.9.7m 23 Feb 2007 
HP-UX Secure Shell-A.05.00.023, HP-UX Secure Shell version 
debug1: Reading configuration data /opt/ssh/etc/ssh_config 
debug1: Connecting to 127.0.0.1 [127.0.0.1.22] port 22. 
debug1: Connection established. 
debug1: permanently_set_uid: 0/3 
debug1: identity file /.ssh/id_rsa type -1 
debug1: identity file /.ssh/id_dsa type -1 
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.0p1+sftpfilecontrol-v1.2-hpn13v1 debug1: match: OpenSSH_5.0p1+sftpfilecontrol-v1.2-hpn13v1 pat OpenSSH* 
debug1: Enabling compatibility mode for protocol 2.0 
debug1: Local version string SSH-2.0-OpenSSH_5.0p1+sftpfilecontrol-v1.2-hpn13v1 debug1: SSH2_MSG_KEXINIT sent 
debug1: SSH2_MSG_KEXINIT received 
debug1: AUTH STATE IS 0 
debug1: REQUESTED ENC.NAME is 'aes128-cbc' 
debug1: kex: server->client aes128-cbc hmac-md5 none 
debug1: REQUESTED ENC.NAME is 'aes128-cbc' 
debug1: kex: client->server aes128-cbc hmac-md5 none 
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent 
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP 
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent 
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY 
debug1: Host '192.168.8.22' is known and matches the RSA host key. 
debug1: Found key in /.ssh/known_hosts:5 
debug1: ssh_rsa_verify: signature correct 
debug1: SSH2_MSG_NEWKEYS sent 
debug1: expecting SSH2_MSG_NEWKEYS 
debug1: SSH2_MSG_NEWKEYS received 
debug1: SSH2_MSG_SERVICE_REQUEST sent 
debug1: SSH2_MSG_SERVICE_ACCEPT received 
debug1: Authentications that can continue: publickey,password,keyboard-interactive 
debug1: Next authentication method: publickey 
debug1: Trying private key: /.ssh/id_rsa 
debug1: Trying private key: /.ssh/id_dsa 
debug1: Next authentication method: keyboard-interactive 
Password: debug1: Authentication succeeded (keyboard-interactive). 
debug1: Final hpn_buffer_size = 131072 
debug1: channel 0: new [client-session] 
debug1: Entering interactive session. 
--------->在这一步等待1分钟到12钟才会出现下面的信息,上面都很正常。 
Last successful login: Sat Jan 8 09:00:55 EAT 2011 X.X.X.X(IP) 
Last authentication failure: Fri Dec 31 15:06:55 EAT 2011 X.X.X.X(IP)
解决方案
检查发现/var/adm/wtmps文件很大: 
# ll /var/adm/wtmps -rw-rw-rw- 1 adm adm 635879830 Jan 16 10:52 /var/adm/wtmps

通过清空该文件后,ssh登录正常。 
#> /var/adm/wtmps (建议在清空前备份该文件) 
在通过SSH登录系统时,ssh的daemon (/usr/bin/sshd)会读/var/adm/wtmps.由于该文件的大小没有限制, 当该文件很大时会影响系统登录的时间。 
通过man帮助能看到下面的信息: 
Note that wtmps and btmps tend to grow without bound, and should be checked regularly. Information that is no longer useful should be 
removed periodically to prevent the file from becoming too large. 
Also note that wtmps and btmps are not created by the programs that maintain them. Thus, if these files are removed, login record-keeping 
is turned off.

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29487349/viewspace-1692717/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
主要从事Oracle数据库 DBA相关工作,其他操作系统、中间件等也有涉及,热衷分享。岁月老将至,如有幸在江湖中留点踪迹,也是欣慰。 【文盲筱烨】好读书爱运动的IT技术爱好者 微博:文盲筱烨 微信公众号:筱烨视点

注册时间:2014-02-15

  • 博文量
    412
  • 访问量
    1104562