1751709 Members
3911 Online
108781 Solutions
New Discussion юеВ

Re: sudo

 
Bigbang_1
Frequent Advisor

sudo

Hi experts!

I will create operator account and this account have to run script as oracle user.
How to configure sudo for that case?

Best regards.
4 REPLIES 4
madhuchakkaravarthy
Trusted Contributor

Re: sudo

hi

u can try with

setacl -m user:operator:rx /oracle


regards

MC
Bigbang_1
Frequent Advisor

Re: sudo

Hi,


I know about ACL but I wanna run script as oracle user.
HP-UX_Ali
Regular Advisor

Re: sudo

Hello Bigbang.

You can edit sudo file (visudo)

User_Alias OPERATORS = operator-name
Cmnd_Alias
BACKUP = /home/oper/oracle.sh
OPERATORS ALL = BACKUP

Else in one line
operator-name ALL= /home/oper/oracle.sh

Choice is all yours...

user has to give sudo -l to list what all previleges as root to execute.


Regards
Ali...
Aneesh Mohan
Honored Contributor

Re: sudo


Hi,

A simple way

1) visudo

2) Add the below entry in sudoers
operator ALL=(oracle) NOPASSWD: /home/oracle/script1.sh

or

operator hostname=(oracle) NOPASSWD: /home/oracle/script1.sh

3) Save it


Usage:-
=====
1) Login as operator

2) $>sudo -u oracle /home/oracle/script1.sh


Regards
Aneesh