【HPUX】HP-UX 11i 因特網和網路處理 - SSH 登入系統慢

xysoul_雲龍發表於2015-06-09
問題
從其他主機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. 
---------&gt在這一步等待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部落格 ” ,連結:http://blog.itpub.net/29487349/viewspace-1692717/,如需轉載,請註明出處,否則將追究法律責任。

相關文章