Page 1 of 1

running script with sudo permission

Posted: 2019/11/21 13:54:36
by knzzz
Hi All,

I want to run a script with sudo perimission to non admin user can any one assist on this

Regards
Kanna

Re: running script with sudo permission

Posted: 2019/11/21 15:07:20
by Errosion
Just to clarify.

You want a non-admin user to be able to run a script utilizing sudo permissions?

Re: running script with sudo permission

Posted: 2019/11/21 23:53:52
by knzzz
Yes , provided with that sudo permission that non admin should run only that script with elevated access

Re: running script with sudo permission

Posted: 2019/11/22 20:30:09
by jlehtone
A sudo rule says:
* who can
* as which user
* run what command

Members of group wheel can impersonate anyone and run all possible commands.
You have to add a rule, where the only valid command is your script.

Re: running script with sudo permission

Posted: 2019/11/23 15:49:31
by MartinR
Best to have a read of sudoers(5) ┬žSecurity Notes. There are a lot of pitfalls in allowing script to be run at elevated privilege and if you get it wrong then a knowledgeable user can escalate privileges all the way to root.

Re: running script with sudo permission

Posted: 2019/11/25 18:42:29
by aks
Add an sudoers entry in /etc/sudoers.d/ and specify the script ONLY as the thing to allow (i.e.: the command).