Page 1 of 1

Why is it so slow to log in after changing the root username and waiting 26 seconds

Posted: 2020/03/03 06:41:47
by duncan98
hi,all
Why is it so slow to log in after changing the root username and waiting 26 seconds
thanks

Re: Why is it so slow to log in after changing the root username and waiting 26 seconds

Posted: 2020/03/03 07:30:44
by TrevorH
Why have you changed the root username in the first place? In more than 20 years of doing this, I've never felt the need to do that.

However, I suspect it has nothing to do with the change.. How are you logging into the machine? Is it over ssh? If so then this sounds like you have an unresponsive nameserver listed in /etc/resolv.conf as ssh does a reverse lookup of the ip address being used to connect and the timeout is 30s.

Re: Why is it so slow to log in after changing the root username and waiting 26 seconds

Posted: 2020/03/03 07:58:50
by duncan98
I logged in via SSH because I didn't want the superuser to be exploited by network attackers, I tried to change the superuser back to root, which logged in very quickly

Re: Why is it so slow to log in after changing the root username and waiting 26 seconds

Posted: 2020/03/03 08:13:23
by TrevorH
Do you have a Match stanza in sshd_config that also tells it UseDNS No?

Re: Why is it so slow to log in after changing the root username and waiting 26 seconds

Posted: 2020/03/03 08:33:39
by duncan98
Yes, the default is UseDNS No

Re: Why is it so slow to log in after changing the root username and waiting 26 seconds

Posted: 2020/03/03 08:50:03
by TrevorH
No, the default setting is UseDNS yes. If you haven't changed it then it will be in effect. And the question is if you have a Match stanza that overrides it for a partition group or user that might include root but not you new name.

Re: Why is it so slow to log in after changing the root username and waiting 26 seconds

Posted: 2020/03/03 09:47:30
by duncan98
TrevorH wrote:
2020/03/03 08:50:03
No, the default setting is UseDNS yes. If you haven't changed it then it will be in effect. And the question is if you have a Match stanza that overrides it for a partition group or user that might include root but not you new name.
Yes, how to explain why logging in is slow after changing root?

Re: Why is it so slow to log in after changing the root username and waiting 26 seconds

Posted: 2020/03/04 17:48:00
by aks
So you changed the root user-name from root to <something_else> and then it was "really slow" to login. You then renamed <something_else> to root and login performance was restored. Correct?
Assuming so:
a) Don't do that.
b) How did you rename root? Did you remember to change all the various paths and nuances from root to <something_else>? I guess not.
c) See a.

Re: Why is it so slow to log in after changing the root username and waiting 26 seconds

Posted: 2020/03/06 08:26:00
by hunter86_bg
Just don't rename root.
Just set in sshd' config 'PermitRootLogin no' and you will be OK.
The defaults for sshd are prety good.