SSH login to a linux server may get delayed or slow if you have a wrong rsyslog server entry or unreachable rsyslog server defined in the configuration file
/etc/rsyslog.conf. To resolve the issue make sure rsyslog server is always reachable from the rsyslog clients. Or else as a workaround edit the rsyslog config file /etc/rsyslog.conf on the client side and comment out all the references related to rsyslog.
1. For example edit the file
/etc/rsyslog.conf and comment out below three lines.
# vi /etc/rsyslog.conf #*.* @@xxx.xxx.xxx.xxx:514 #daemon.*;daemon.!info /var/log/messages #local0.info /var/log/asmaudit.log
2. Restart rsyslog service.
# service rsyslog restart # CentOS/RHEL 6 # systemctl restart rsyslog # CentOS/RHEL 7
rsyslog service needs to be restarted in-case of any changes to rsyslog config file.
sshd service will trying to log the login attempts and other informative logs to syslog files but if there is load on system, or some issue with syslog service during that time then this delays the connections till the request is timed out. This can be worked around by either resolving the connectivity issue with rsyslog server or by commenting out the lines referencing the unreachable rsyslog server.
If you are facing any issue / error then just click here .