SSH連線卡頓

2021-08-24 17:57:10 字數 3009 閱讀 2901

在linux中,預設就是開啟了ssh的反向dns解析,這個會消耗大量時間,因此需要關閉。

# vi /etc/ssh/sshd_config

usedns=no

在配置檔案中,雖然usedns yes是被注釋的,但預設開關就是yes

在authentication gssapi-with-mic有很大的可能出現問題,因此關閉gss認證可以提高ssh連線速度。

# vi /etc/ssh/sshd_config

gssapiauthentication no

service sshd restart
測試一下ssh鏈結卡在那個地方

[xiao@localhost ~]$ ssh -v [email protected]

openssh_5.3p1, openssl 1.0.1e-fips 11 feb 2013

debug1: reading configuration data /etc/ssh/ssh_config

debug1: connecting to 192.168.174.149 [192.168.174.149] port 22.

debug1: connection established.

debug1: identity file /home/xiao/.ssh/identity type -1

debug1: identity file /home/xiao/.ssh/identity-cert type -1

debug1: identity file /home/xiao/.ssh/id_rsa type -1

debug1: identity file /home/xiao/.ssh/id_rsa-cert type -1

debug1: identity file /home/xiao/.ssh/id_dsa type -1

debug1: identity file /home/xiao/.ssh/id_dsa-cert type -1

debug1: identity file /home/xiao/.ssh/id_ecdsa type -1

debug1: identity file /home/xiao/.ssh/id_ecdsa-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.3

debug1: ssh2_msg_kexinit sent

debug1: ssh2_msg_kexinit received

debug1: kex: server->client aes128-ctr hmac-sha1 none

debug1: kex: client->server aes128-ctr hmac-sha1 none

debug1: ssh2_msg_kex_dh_gex_request(1024<2048<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

the authenticity of host '192.168.174.149 (192.168.174.149)' can't be established.

rsa key fingerprint is 01:e2:4c:36:39:b6:5a:de:28:87:92:1d:6a:74:2a:e0.

are you sure you want to continue connecting (yes/no)?

warning: permanently added '192.168.174.149' (rsa) to the list of known hosts.

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,gssapi-keyex,gssapi-with-mic,password

debug1: next authentication method: gssapi-keyex

debug1: no valid key exchange context

debug1: next authentication method: gssapi-with-mic

debug1: unspecified gss failure. minor code may provide more information

cannot determine realm for numeric host address

debug1: unspecified gss failure. minor code may provide more information

cannot determine realm for numeric host address

可以看見ssh鏈結卡在gss認證那一步。

解決ssh連線虛擬機器卡頓

關閉防火牆 chkconfig iptables off 關閉selinux 臨時關閉 setenforce 0 永久關閉 vim etc sysconfig selinux selinux disabled vim etc ssh sshd config 修改 gssapiauthenticati...

SSH登入卡頓解決方案

在使用ssh遠端登入linux主機時,經常出現需要等待一段時間才能登入,甚至登入超時的情況 原因一 ssh伺服器預設開啟了dns的查詢功能 usedns yes 當usedns選項處於開啟狀態時,客戶端試圖登入ssh伺服器,伺服器端先根據客戶端的ip位址進行dns ptr反向查詢出客戶端的主機名,然...

mysql定期卡頓 MySQL卡頓和優化

1.若是是你,你怎麼處理慢查詢引發的問題,而且在之後避免這種狀況發生?sql 對於mysql的慢查詢問題,一般咱們是這麼幹的 1 開啟mysql伺服器的慢查詢記錄功能 mysql set global slow query log on mysql show variables like slow ...