running script with sudo permission

Support for security such as Firewalls and securing linux
Post Reply
knzzz
Posts: 136
Joined: 2017/02/25 12:41:42

running script with sudo permission

Post by knzzz » 2019/11/21 13:54:36

Hi All,

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

Regards
Kanna

User avatar
Errosion
Posts: 29
Joined: 2014/12/03 19:58:02

Re: running script with sudo permission

Post by Errosion » 2019/11/21 15:07:20

Just to clarify.

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

knzzz
Posts: 136
Joined: 2017/02/25 12:41:42

Re: running script with sudo permission

Post by knzzz » 2019/11/21 23:53:52

Yes , provided with that sudo permission that non admin should run only that script with elevated access

User avatar
jlehtone
Posts: 2432
Joined: 2007/12/11 08:17:33
Location: Finland

Re: running script with sudo permission

Post by jlehtone » 2019/11/22 20:30:09

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.

MartinR
Posts: 466
Joined: 2015/05/11 07:53:27
Location: UK

Re: running script with sudo permission

Post by MartinR » 2019/11/23 15:49:31

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.

aks
Posts: 2859
Joined: 2014/09/20 11:22:14

Re: running script with sudo permission

Post by aks » 2019/11/25 18:42:29

Add an sudoers entry in /etc/sudoers.d/ and specify the script ONLY as the thing to allow (i.e.: the command).

Post Reply

Return to “CentOS 8 - Security Support”