Most the time when we add a new user to group and try to run sudo command on that user,we encounter error :
one can be used while creating a new user,and another is for those who have already created the user and are wondering to use sudo with that user.
this user is not present in the sudoers list
to solve this problems we have to easy methods.one can be used while creating a new user,and another is for those who have already created the user and are wondering to use sudo with that user.
First we will go with the those who have already created the user :
- login with a use who is already present in the sudoers list
- open the teminal window and type in sudo adduser username sudo.
now lets come to those who want to create a new user and mention it in the sudoers list:
- you have to add option while creating a new user.
- just add the option -G sudo in the useradd command.
- for eg. useradd -u 500 -g dba -G sudo -d /home/oracle oracle.
basically sudo is a group and all the users present in this group will have the full control over the sudo command.we are just adding the user to the sudo group.
No comments:
Post a Comment