How to assign sudo privilege to user

sudo is a program for Unix-like computer operating systems that allows users to run programs with the security privileges of another user, by default the superuser. It originally stood for "superuser do" as the older versions of sudo were designed to run commands only as the superuser.

This article explains the steps to assign sudo privilege to a user.

Run visudo command.

#visudo

When you type this command, you will be taken into a text editor session with the file that defines sudo privileges pre-loaded. We will have to add our user to this file to grant our desired access rights.

Find the part of the file that is labeled "User privilege specification". It should look something like this:

# User privilege specification
root ALL=(ALL:ALL) ALL

We give a user sudo privileges by copying the line beginning with "root" and pasting it after. We then change the user "root" on the new line to our new user, like this:

# User privilege specification
root ALL=(ALL:ALL) ALL
newuser ALL=(ALL:ALL) ALL

Save the file and close it.

That's all.......

Leave a Reply

Your email address will not be published. Required fields are marked *