1832313 Members
1954 Online
110041 Solutions
New Discussion

sudo

 
Chirag Parekh
Advisor

sudo

Hi,

Is there a way to execute a shell script owned by non-root user via sudo.

Thanks.
2 REPLIES 2
Bill Hassell
Honored Contributor

Re: sudo

It's pretty simple. Just type sudo /path-to-shell-script. Just put the shell script path into the sudoers file for that user.


Bill Hassell, sysadmin
Basheer_2
Trusted Contributor

Re: sudo

This is the way i have done.

I had to give permissions to operators to manage printers.
instead of typing each command with sudo

put in their .profile
alias scrpit_to_run="sudo /path/script_to_run"


then they will just type script_to_run
instead of sudo script_to_run