Tried googling, but I must not be asking the right question cause I'm coming up with nada. I'm setting up a SuSE box to run a ton of production jobs. Most are handled via cron, so on those it's simple to specify the user they should run under. There are a couple of jobs that must be initiated by normal users, but these jobs must run from a special user that has permissions far greater than the normal user. The jobs are all bash shell scripts, how can I set it up so user A can submit a background shell job under User B? Note: One further complication, I envision user A firing off the job via a web page, probably a perl cgi script that would actually be running as wwwrun on that same box, so user A isn't really logged onto the box. Scott -- POPFile, the OpenSource EMail Classifier http://popfile.sourceforge.net/ Linux 2.6.11.4-21.7-default x86_64
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, Scott Leighton wrote:
I'm setting up a SuSE box to run a ton of production jobs. Most are handled via cron, so on those it's simple to specify the user they should run under.
There are a couple of jobs that must be initiated by normal users, but these jobs must run from a special user that has permissions far greater than the normal user.
The jobs are all bash shell scripts, how can I set it up so user A can submit a background shell job under User B?
You could use "sudo" for that. It's pretty powerful and allows normal users to execute commands under a different user ID.
Note: One further complication, I envision user A firing off the job via a web page, probably a perl cgi script that would actually be running as wwwrun on that same box, so user A isn't really logged onto the box.
That should be doable with sudo, too. Bye, LenZ - -- - ------------------------------------------------------------------ Lenz Grimmer <lenz@grimmer.com> -o) [ICQ: 160767607 | Jabber: LenZGr@jabber.org] /\\ http://www.lenzg.org/ V_V -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCuPraSVDhKrJykfIRAsGJAJ9fnv7w9/BIva3uBzOTqDyM+PCL6ACfVkMX n1VLYps7MWKKCUBjd9Htf8E= =VNye -----END PGP SIGNATURE-----
Scott Leighton wrote:
Tried googling, but I must not be asking the right question cause I'm coming up with nada.
I'm setting up a SuSE box to run a ton of production jobs. Most are handled via cron, so on those it's simple to specify the user they should run under.
There are a couple of jobs that must be initiated by normal users, but these jobs must run from a special user that has permissions far greater than the normal user.
The jobs are all bash shell scripts, how can I set it up so user A can submit a background shell job under User B?
Note: One further complication, I envision user A firing off the job via a web page, probably a perl cgi script that would actually be running as wwwrun on that same box, so user A isn't really logged onto the box.
The su command can be used to run apps as other users, not just root. Look at the -c option. You'll probably also wnat to look at sudoers.
participants (3)
-
James Knott
-
Lenz Grimmer
-
Scott Leighton