SSH is slow to make a connection [duplicate]

This is slow because the OpenSSH daemon uses DNS to run a reverse lookup on the client hostname to make sure it's valid

sudo vim /etc/ssh/sshd_config

Comment out the following lines

#GSSAPIAuthentication yes
#GSSAPIDelegateCredentials no

or add this:

UseDNS no

Then, restart sshd service or reboot your server

sudo systemctl restart sshd

Enjoy !