Operating System - HP-UX
1753284 Members
5203 Online
108792 Solutions
New Discussion юеВ

Sudo not working for a apecific user

 
SOLVED
Go to solution
gany59
Regular Advisor

Sudo not working for a apecific user

Hi Techiees,

How can we give the sudo privilages to the specific user. where can i put the entry in the suoers file.

Pls help me out!!!!!!!!!
3 REPLIES 3
Steve TZ
Advisor

Re: Sudo not working for a apecific user

Hello,

Use visudo command to edit the sudo file. The sudo file should normally be "/etc/sudoers".
For more details, check man visudo.

Regards,
gany59
Regular Advisor

Re: Sudo not working for a apecific user

the sudo access in the sense root access right ?
so how can i add the entry for the specific one in that sudoers file.
Steve TZ
Advisor
Solution

Re: Sudo not working for a apecific user

Hi,

Suppose you want to add user "test" in sudo file. Depending on which command you want to allow to the user, there are many types of entries in the sudo file. Let say you want to allow to "test" user to execute all commands which need root privilegies. The entry will be:
Examples of entry in sudo file

test ALL = ALL
test ALL = NOPASSWD: ALL

Two ways to perform the task:

1) If you have root password, log into the system as root and type visudo

2) If you don't have root password but you have an account which is allowed to use sudo. Log into the system with that user and do the following:

sudo su -
visudo

After you have typed visudo, you can add one of the entry given in the examples:
In the first example, user will be prompted to fill his password
In the second example, no password will be required.(Be carefull with this one)

Note that visudo command read the sudo file. You don't need to edit it manually. visudo will do the job. Don't forget to check man visudo for more details.

Regards,
Steve