IT & IoT Security | Cloud | It's all about the life itself

Nothing in life is as important as you think it is, while you are thinking about it.

Linux – Sudoers

Dear readers,

In this post, I am going to cover the sudoers in CentOS7. You all probably know that su means super user or substitute user and sudo means “do as su(per user)” ­čÖé

If you login to the system as root user, you are allowed to run all of the commands. I will try to perform several tasks as normal user for you to review the results.

Screen Shot 2016-05-24 at 18.53.49

Let’s try to run command by using sudo then.

Screen Shot 2016-05-24 at 19.05.22

If we focus on the output, we can find out that the user must exist in the sudoers file to accomplish this task. Sudoers file allows users to run commands as root user without needing the root’s password. This file must be edited with┬áthe┬ávisudo command!

Screen Shot 2016-05-24 at 20.14.13

According to the sudoers file shown above, we have two options to make baris.aydogmusoglu account a sudoer.

1st option:

baris.aydogmusoglu ALL=(ALL) ALL

We can edit the file add the line above just under the root ALL=(ALL) ALL line.

2nd option:

We can add baris.aydogmusoglu user account to wheel group since each member of the group is a sudoer (according to the file shown above). Actually, I would rather prefer add user accounts the group those we want to make sudoer. I will continue with the second option.

Screen Shot 2016-05-24 at 20.22.34

Let’s try to run command by using sudo again.

Screen Shot 2016-05-24 at 20.43.42

Screen Shot 2016-05-24 at 20.44.13

Now,┬ábaris.aydogmusoglu user has┬ásuccessfully become a sudoer ­čÖé

I wish you have a great day.



Leave comment

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