Please don’t reply on top (top post). Reply at the bottom so the
conversation can be followed easier.
On Tue, Dec 24, 2013 at 1:18 AM, saravanan p
Assuming you do really mean a ruby script, and nothing in your Rails app,
you can set the setuid bit with chmod and chown the script to root. When it
executes, it will execute with root persmissions.
Given you’ve not been able to find this information yourself, I’d again
caution you not to do this.
That is insecure, yes.
It is possible to use sudo in situations like this, where you don’t
have user access to type in the password securely.
Sudo can be configured to allow a user to execute a command or a class
commands with elevated privileges.
Read the sudoers man page for more information on how to set this up.
Nevertheless, I caution you to avoid this situation. I am unclear why
need to do this from inside an application.