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

Issues related to configuring your network
Post Reply
duncan98
Posts: 9
Joined: 2020/03/03 06:35:40

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

Post by duncan98 » 2020/03/03 06:41:47

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

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

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

Post by TrevorH » 2020/03/03 07:30:44

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.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

duncan98
Posts: 9
Joined: 2020/03/03 06:35:40

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

Post by duncan98 » 2020/03/03 07:58:50

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

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

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

Post by TrevorH » 2020/03/03 08:13:23

Do you have a Match stanza in sshd_config that also tells it UseDNS No?
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

duncan98
Posts: 9
Joined: 2020/03/03 06:35:40

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

Post by duncan98 » 2020/03/03 08:33:39

Yes, the default is UseDNS No

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

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

Post by TrevorH » 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.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

duncan98
Posts: 9
Joined: 2020/03/03 06:35:40

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

Post by duncan98 » 2020/03/03 09:47:30

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?

aks
Posts: 3073
Joined: 2014/09/20 11:22:14

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

Post by aks » 2020/03/04 17:48:00

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.

hunter86_bg
Posts: 2019
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

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

Post by hunter86_bg » 2020/03/06 08:26:00

Just don't rename root.
Just set in sshd' config 'PermitRootLogin no' and you will be OK.
The defaults for sshd are prety good.

Post Reply