April 21, 2021



Debian/Ubuntu – Give user admin rights (Add to sudo)

Office-Customer-Male-Light-iconFor security reason, and others, it is a good idea to use another user than root. There is several ways of doing this.

On a Debian system sudo is most likely not installed (it’s default on Ubuntu).
apt-get install sudo

If it is a new user, and needed to be created first:
adduser john

And add it to the sudo group.
adduser john sudo

Now your user john will have access to use sudo.

Now your user john has been naughty and need his admin rights removed.
deluser john sudo

The command above will remove the user john from the sudo group, but it will keep the user john.
To delete his account completly, just leave the group out.
deluser john

The command above will still keep johns home directory. To delete his account and home directory.
deluser –remove-home john

Happy using!