Operating System - HP-UX
1819791 Members
3331 Online
109607 Solutions
New Discussion юеВ

need to give "sudo" access to one user

 
SOLVED
Go to solution
praveen..
Super Advisor

need to give "sudo" access to one user

Hi,
I need to give "sudo" access to one user, how can i do this?

that user needs to run some root commands of "powermt" ..etc

Please suggest
9 REPLIES 9
Arunvijai_4
Honored Contributor

Re: need to give "sudo" access to one user

Hi Praveen,

Edit /etc/sudoers file and add the user and "powermt" command.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
praveen..
Super Advisor

Re: need to give "sudo" access to one user

No /etc/sudoers file is there..... :-(
Raj D.
Honored Contributor

Re: need to give "sudo" access to one user

Praveen ,

Use the find command to find the sudoers file.

many times it resides under /usr/local/etc/sudo/sudoers

else:
# find / -name sudoers -print

And add the full patch of the powermt command on the access list of sudoers , for that user/group.


Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Raj D.
Honored Contributor
Solution

Re: need to give "sudo" access to one user

Praveen ,

Use the find command to find the sudoers file.

many times it resides under /usr/local/etc/sudo/sudoers

else:
# find / -name sudoers -print

And add the full path of the powermt command on the access list of sudoers , for that user/group.


Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Kenan Erdey
Honored Contributor

Re: need to give "sudo" access to one user

and also, the command "visudo" opens sudoers file directly. and before closing checks the syntax.
Computers have lots of memory but no imagination
ricky2
Frequent Advisor

Re: need to give "sudo" access to one user

hi praveen,

its better to use the visudo which will open the sudoers file directly and you can include the login id of the user to whom u need to give the sudo acess.

Rgds,
Ricky
praveen..
Super Advisor

Re: need to give "sudo" access to one user

root@server:[/root]# whereis powermt
powermt: /sbin/powermt
root@server:[/root]# find / -name sudoers
/opt/iexpress/sudo/etc/sudoers
/opt/iexpress/sudo/newconfig/opt/iexpress/sudo/etc/sudoers

username: laoracle

please let me know how to give sudo access to "laoracle" user.
what will be entry format?

Kenan Erdey
Honored Contributor

Re: need to give "sudo" access to one user

run visudo. adding a line like:
laoracle ALL= /sbin/powermt

will be enough i think.
Computers have lots of memory but no imagination
Raj D.
Honored Contributor

Re: need to give "sudo" access to one user

Praveen,

You can use the visudo command to edit the sudoers file.


Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "