Quick answer: Run adduser deploy (Ubuntu/Debian) or useradd -m deploy && passwd deploy (AlmaLinux/Rocky), then grant admin rights with usermod -aG sudo deploy (Ubuntu/Debian) or usermod -aG wheel deploy (RHEL family). Day-to-day work as a non-root user is a security best practice.
Overview
Working as root full-time is risky: any typo or hijacked session has unlimited power. The standard pattern is a personal user with sudo for administrative commands, with direct root login eventually disabled.
Before you start
- Root SSH access.
- A username and strong password (or better, an SSH key) for the new user.
Step-by-step guide
- Create the user. Ubuntu/Debian:
AlmaLinux/Rocky:adduser deployuseradd -m deploy passwd deploy - Grant sudo. Ubuntu/Debian:
AlmaLinux/Rocky:usermod -aG sudo deployusermod -aG wheel deploy - Install an SSH key for the user (from your computer):
ssh-copy-id [email protected] - Test before logging out of root:
ssh [email protected] sudo whoami # should print: root
Common issues
user is not in the sudoers file? The group step was missed or it's the wrong group for the distro (sudo vs wheel). Fix as root.- Group change not applied? Log out and back in — group membership refreshes at login.
- Locked yourself out? Use the KVM Console on the service page to log in locally and repair.
When to contact support
User management inside the OS is under your control on an unmanaged VPS, but if you've lost all access, open a support ticket and we'll help via console.
Frequently asked questions
Why not just work as root?
A single typo or a hijacked root session has unlimited power. A sudo user adds a safety layer and an audit trail.
Which group gives admin rights?
On Ubuntu and Debian membership in the sudo group grants admin rights; on AlmaLinux and Rocky it is the wheel group. Add a user with usermod -aG sudo username or usermod -aG wheel username.
The user cannot run sudo — why?
Group membership is read at login, so a freshly added sudo or wheel user must log out and back in before it takes effect. Verify the active groups of the session with the groups command.
Related articles
Need a hand? Contact Cloud2Y support →
