Skip to content

Knowledge Base

Creating an administrative user and using sudo

Create a personal administrator rather than using root for routine work.

Debian and Ubuntu

adduser operator
usermod -aG sudo operator

AlmaLinux

useradd -m operator
passwd operator
usermod -aG wheel operator

Alpine Linux

adduser operator
adduser operator wheel

Copy a public key into the new user’s ~/.ssh/authorized_keys, set the directory to mode 700 and the file to 600, then correct ownership with chown -R operator:operator.

Test sudo -v and a new SSH login before restricting root. Grant only the privileges required; avoid broad passwordless sudo entries for application accounts.

Please rate this article to help us improve our Knowledge Base.

0 0