Who this is for:
Linux VPS customers who want safer day-to-day server access.
Overview:
Instead of using root for everything, it is safer to create a normal user with sudo privileges.
Steps on AlmaLinux / CentOS / Rocky / Ubuntu / Debian:
-
Log in as root.
-
Create a new user:
adduser yourusername
or on some systems:
useradd -m yourusername
passwd yourusername
passwd yourusername
-
Set a password for the user.
-
Add the user to the sudo or wheel group.
For Ubuntu/Debian:
usermod -aG sudo yourusername
For AlmaLinux/CentOS/Rocky:
usermod -aG wheel yourusername
How to verify it worked:
Log in as the new user and run:
sudo whoami
It should return root.
When to contact support:
Contact support if sudo does not work or you accidentally remove your own access.