Working with root (admin privileged user) in Ubuntu is not a good idea because you can easily make a costly mistake. Instead, it’s much better to grant the special sudo privileges which allow a regular user to run super user commands by just preceding the commands with sudo in front.
Example of a sudo command:
By default, a fresh Ubuntu installation comes with an user who has sudo privileges. To create a new sudo user, you first need a regular user. To create it run the command:
sudo adduser your_user
Then open the file /etc/sudoers and you have two options. First is to add a user which is asked for a password when running sudo commands:
your_user ALL=(ALL:ALL) ALL
The second, less secure alternative is to allow the user to run sudo commands without being asked for a password:
your_user ALL=(ALL:ALL) NOPASSWD:ALL
That’s how easy it is to have a sudo user in Ubuntu if you already don’t have one or if you need additional ones.