When connecting via SSH, server perform a reverse DNS lookup of client's IP address. However, when connecting inside local network and server or client do not have global IP address, it is impossible to perform DNS lookup, and server must wait for connection time out. Thus, connecting via SSH takes so much time.
There are two solutions to this problem.
(both need changing setting on a server)
Adding information about local IP address to the hosts file
Add the following to the /etc/hosts file:
[client IP address] [client host name]
E.g. When client IP address is 10.0.0.1 and host name private.example.com
Disable reverse DNS lookup in SSH settings
Change the following in /etc/ssh/sshd_config file:
After saving changes reload SSH settings using the following command