security.frabs.net
All Guides

Logins · about 5 minutes

Remove Extra Accounts With Root Powers

What This Means

An account other than root has user ID 0, which makes it root under another name.

Why It Matters

Attackers add hidden root accounts like this to keep their way back in. Unless you made it on purpose, treat it as a sign of a break-in.

  1. 1

    List every account with user ID 0

    Only root should be here.

    awk -F: '$3 == 0' /etc/passwd
    Terminal: List every account with user ID 0, on Ubuntu 24.04
  2. 2

    See when it was added

    The login log and the account's last login help work out who made it.

    lastlog -u toor; grep -i toor /var/log/auth.log | tail -5
  3. 3

    Remove it

    If you didn't create it, delete it. -f removes it even though it shares root's ID.

    userdel -f toor
    Terminal: Remove it, on Ubuntu 24.04
  4. 4

    Confirm only root is left

    awk -F: '$3 == 0' /etc/passwd
    Terminal: Confirm only root is left, on Ubuntu 24.04

Check It’s Fixed

Run the security report again. This check should now pass.

More Logins Guides

Stop Root Logging In Over SSH With a PasswordTurn Off SSH Password LoginsLimit SSH Password TriesLock Accounts With No Password