Use SSH to telnet to Linux after entering the user name after several seconds before the input password. Serious impact on productivity. Logon is slow, log on up after the normal speed, the main reason for this situation is: DNS Reverse resolution problem
SSH at the time of login generally we enter the IP address of the server. It uses reverse DNS to find the hostname based on the IP, then uses DNS to find the IP address, and finally matches the logon IP is legitimate. If the IP does not have a domain name, or if the DNS server is slow or not, logging in will take time.
Workaround:
Modify the SSHD server-side configuration on the target server and restart the sshd
Vi/etc/ssh/sshd_config, set Usedns to No
There is no delay when you telnet to the machine.
modifying scripts
#!/bin/bash#===============================================================================# # file:ssh_dns.bash## USAGE:SSHusedns Parameter Modification script## description:to ModifySSHusedns parameter## BUGS:---# NOTES:---# author:paul_hch # MAIL: # CREATED: to/ -/ . the: the: topm# VERSION:1.0#===============================================================================#备份sshd_configCP-a/etc/SSH/sshd_config/etc/SSH/Sshd_config.bakif[[ $? =0]]; ThenEcho-E'\e[1;32mthe sshd_config backup successfully! \e[0m'Echo "" ElseEcho-E'\e[1;31mthe sshd_config Backup failed! Please check it out.\e[0m'Echo ""Exitfi#查看目前的USEDNS参数Echo-E'\e[1;32mthe sshd_config usedns Parameter now: \e[0m'grepdns/etc/SSH/sshd_config# Modifying Parameterssed-I.'s/#UseDNS yes/usedns no/'/etc/SSH/Sshd_configif[[ $? =0]]; ThenEcho-E'\e[1;32mthe usedns Parameter modification successfully! \e[0m'grepdns/etc/SSH/Sshd_configEcho "" ElseEcho-E'\e[1;31mthe usedns Parameter modification failed! Please check it out.\e[0m'Echo ""Exitfi#重启sshd服务Echo-E'\e[1;32mthe sshd is restarting now: \e[0m'Service sshd Restart
Linux server logon slow to appear in Dayton