Link to home
Create AccountLog in
Avatar of vamsi_uk

asked on

Sudo Access on Solaris

Hi Experts,

I have a script which is owned by user1. I want user2 to be able to execute this script for which i want user2 to use sudo. So far i have tried this..


User_Alias  TEST = user1
Runas_Alias TEST = user1

user2    ALL=(TEST) ALL

Now when i try the following command i get an error:

[user2@sun4]$ sudo ./
Sorry, user user2 is not allowed to execute './' as root on sun4.

I am not sure why or how i can execute the script of user1 using sudo

Thanks in advance
Avatar of omarfarid
Flag of United Arab Emirates image

Here example on how to use sudo:

Entry in /etc/sudoers

dgb    boulder = NOPASSWD: (operator) /bin/ls, /bin/kill, /usr/bin/lprm

The user dgb may run /bin/ls, /bin/kill, and /usr/bin/lprm -- but only as operator.  E.g.,

  $ sudo -u operator /bin/ls

In your case:

user2    boulder = NOPASSWD: (user1) ./

Here some useful links:
Avatar of PsiCop
Flag of United States of America image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account