Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I let users run a script with root permissions?

Given the dangers of SUID shell scripts, is there a more secure way of giving passwordless access to scripts (bash, PHP) with root permissions in Linux?

(Ubuntu 8.10)

like image 960
Ken Avatar asked Dec 29 '08 12:12

Ken


2 Answers

alt text

like image 58
Yuval Adam Avatar answered Oct 25 '22 02:10

Yuval Adam


You could consider sudo.

Although not 'passwordless', it doesn't require the user to be given the root password. It can also provide an audit trail of use of the script.

edit: as per comment from Chris, there is an option not to require a password at all for certain commands, see here for details. It can also be set up not to prompt excessively for the password, i.e. one entry of the password can be good for multiple commands over a period of use.

By the way, sudo is built in to Ubuntu and nicely integrated with Gnome. When ubuntu prompts you for your password to do privileged operations, that's sudo under the hood.

like image 30
frankodwyer Avatar answered Oct 25 '22 02:10

frankodwyer