Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem that ssh login is very slow?

2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the knowledge of "ssh login is very slow how to solve", in the actual case of the operation process, many people will encounter such a dilemma, then let the editor lead you to learn how to deal with these situations! I hope you can read it carefully and be able to achieve something!

1. DNS reverse parsing problem

OpenSSH verifies IP when the user logs in. It uses reverse DNS to find the hostname based on the user's IP, then uses DNS to find the IP address, and finally matches whether the logged-in IP is legal. If the client's IP does not have a domain name, or if the DNS server is slow or unavailable, then logging in can be time-consuming.

Solution:

Modify the sshd server-side configuration on the target server and restart sshd

Vi / etc/ssh/sshd_configUseDNS no2. Turn off gssapi authentication for ssh

With ssh-v user@server, you can see the following information when logging in:

Debug1: Next authentication method: gssapi-with-micdebug1: Unspecified GSS failure. Minor code may provide more information

Note: ssh-vvv user@server can see more detailed debug information.

Solution:

Modify sshd server-side configuration

Vi / etc/ssh/ssh_configGSSAPIAuthentication no

You can use ssh-o GSSAPIAuthentication=no user@server to log in to GSSAPI (Generic Security Services Application Programming Interface), which is a set of general network security system interfaces similar to Kerberos 5. This interface encapsulates various security mechanisms of client and server to eliminate differences in security interfaces and reduce the difficulty of programming. However, there will be problems with this interface when there is no domain name resolution on the target machine. After checking with strace, it is found that ssh performs authentication gssapi-with-mic after verifying key. Connect to the DNS server at this time, and other operations will be done after that.

This is the end of the content of "ssh login is very slow how to solve". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 234

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report