[ale] make some apps/scripts run as root
Michael B. Trausch
mike at trausch.us
Tue Feb 22 18:17:28 EST 2011
On Tue, 2011-02-22 at 14:34 -0500, Narahari 'n' Savitha wrote:
> How do I run a few scripts like my IDE launcher, the Websphere server
> etc., to run as sudo aka root without prompting me for the password
> each time ?
As Mike W. pointed out, there is little need to run such things as the
superuser.
If you need to start a dæmon that needs to listen on a privileged port,
there are a few ways that you can do this. You can grant the approriate
capability to the user account that runs the software (or to the
software itself, using filesystem capabilities), though this is not a
universally supported method of operation (why, I'm not sure).
The other means would be to have a small (and I mean *tiny*) program
that runs setuid root and does ABSOLUTELY nothing other than to acquire
the listening socket, drop root privileges permanently, and then exec
the target program. That might require a patch to the target program so
that it can take the listening socket file descriptor either on a
well-known file descriptor or via a command line option that can pass in
the fd number.
There are more clever means to do these sorts of things, as well. They
are, however, left as an exercise to the reader.
> Also how do you start any gui app minimized, I need to run VMWare
> tools as root and minimized.
That depends on the toolkit that the program in question is built to run
with. For GTK+ based software, I am not aware of any such
functionality.
--- Mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
Url : http://mail.ale.org/pipermail/ale/attachments/20110222/9823b074/attachment.bin
More information about the Ale
mailing list