Running shell scripts with sudo through my Rails app
Posted
by nfm
on Stack Overflow
See other posts from Stack Overflow
or by nfm
Published on 2010-06-08T06:09:50Z
Indexed on
2010/06/08
6:32 UTC
Read the original article
Hit count: 438
In my Rails app, I have some functionality that interfaces with the server's OS. I've written a bash script, put it in my lib/
subdirectory, and can run it from my controller.
However, some functionality of the script requires superuser privileges.
What is the most sane way to run this script securely? It is being passed arguments from a web form, but should only be able to be called by authenticated (and trusted) users.
© Stack Overflow or respective owner