SSH server is by default configured to perform reverse DNS lookup of your IP address every time you try to log in to the server. It could slightly improve logging and security, but would significantly increase login time.
Related: How to speed up SSH authentication
Basically, the login prompt could take a while to appear as the server will perform reverse DNS lookup on the incoming IP address before presenting the login prompt.
You can fix this issue by disabling the UseDNS directive on the SSH server from the terminal.
Specifies whether sshd(8) should look up the remote host name and check that the resolved host name for the remote IP address maps back to the very same IP address. The default is “yes”.
$ sudo vi /etc/ssh/sshd_config [sudo] password for user:
Add the line if it doesn't already exist and remove the # at the beginning of the line if existing line starts with #.
$ sudo systemctl restart sshd
|Red Hat Enterprise Linux|
|SUSE Linux Enterprise Server|
Comment anonymously. Login not required.