M
M
msnyastar2020-02-05 02:26:57
linux
msnyastar, 2020-02-05 02:26:57

Linux: What to do with root after creating a user with normal rights?

Hello!
I actually created a user for VPS Ubuntu 18.04.3, added it to sudo, I can log in by key.
But root hasn't gone anywhere? What is the point then? The manuals say that this affects security, does it mean that I will work not as root? Or now you still need to somehow hide the root from those who want to connect to the server under the root?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
C
chupasaurus, 2020-02-05
@msnyastar

Run strictly after making sure that sudo works and the ability to connect via ssh to another user.
PermitRootLogin noin /etc/ssh/sshd_config (prohibition of root login via ssh) and sudo passwd --lock root(prohibition of local root login by password).

C
CityCat4, 2020-02-05
@CityCat4

What to do with root after creating a user with normal rights?

Nothing. Disable the ability to authenticate in ssh - and that's it, you don't need to do anything else. Root is used for system configuration tasks, everything else is done under a normal user.

G
Germanjon, 2020-02-05
@Germanjon

If work from under root is not expected (in 99.9% of cases it can be replaced with sudo), then it is enough to do the above: disable root in ssh and prohibit local login.
If you still need root for some reason (or at first you are afraid of working with sudo), then you can rename root to another non-standard username so that the attacker picks up not only the password, but also the login.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question