How to Create a New Sudo User on Ubuntu
VPS Servers · Self-help guide
Using a separate sudo user is safer than using root for every task. Connect to your Ubuntu VPS as root or an existing sudo user. Create the new user with sudo adduser username, replacing username with the person or role name. Follow the prompts and set a strong password. Add the user to the sudo group with sudo usermod -aG sudo username. Test access by opening a new SSH session and running su - username or logging in directly, then run sudo whoami. It should return root. Do not close your original session until you confirm the new user works. Remove unused users when access is no longer needed.