How to add an admin user in Linux
![How to add an admin user in Linux](/content/images/size/w2000/2021/01/brooke-lark-nMffL1zjbw4-unsplash.jpg)
To add a new user with admin (root) privilege, named "new-username" with password "new-username-pass"
sudo adduser new-username
sudo usermod -aG root new-username
sudo passwd new-username
Then type a new username's password or follow the instruction of the interactive commands.
To remove user
sudo userdel new-username
Sometimes, for example in Ubuntu 20.04, the sudo
group is used, in that case use sudo usermod -aG sudo new-username
.
![Buy Me A Coffee](https://cdn.buymeacoffee.com/buttons/v2/default-red.png)