I have an account named as Chankey (local user). I had to use some commands like viewing the shadow file etc. I tried it using sudo command
sudo vim /etc/shadow
It said:
Chankey is not in the sudoers file. This incident will be reported.
How can I add this user Chankey to the sudoers file?
Best Answer
You need to have root access to add a user to the sudoers file. So either
(and put the root password in) and then use
as root to make the relevant and correct changes, or ask your sysadmin.
You usually want something like,
or,
and put your user ID into that group, but how you configure sudo depends on the standards for your environment.
Changing the sudo config file should only ever be done with
visudo
(to prevent being locked out by making a bad change), and it should only be done by someone who understands how to configure sudo safely (personal soapbox: sudo is not the tool some people think it is).