Slow SSH login on CentOS 7 cPanel

On CentOS 7, when you find it’s slow to ssh to the server, this happens when dbus was restarted, but systemd-logind was not restarted.

To fix the issue, you just need to restart the systemd-login service.

Check systemd-logind status

systemctl status systemd-logind

When you see error like this, restart the systemd-logind service will fix the issue:

your_server systemd-logind[13432]: Failed to abandon session scope: Transport endpoint is not connected

Restart it

systemctl restart systemd-logind

This issue may occur again after a while(like after cPanel updates), you can use cronjob to run following script to restart systemd-login when it finds the error shows up.

#!/bin/bash
#
# By cpanelcares.com

hn=`hostname`
check=`systemctl status systemd-logind|grep ‘Failed to abandon session scope’`

if [ -n “$check” ]
then
systemctl restart systemd-logind
fi