Click to See Complete Forum and Search --> : exec()
mf22cs
06-09-2003, 11:11 AM
Hmmm...
I wonder, since exec() run as the user "nobody" how can I get it to do things that I in shell only can do as myself.
Shellscript? (I used UNIX tcsh-script 5 years ago... not since then).
/Marcus
AdamGundry
06-09-2003, 02:26 PM
Possibly using su? There could be a security problem there though - maybe if you created a shell script which contained the su command.
Adam
mf22cs
06-09-2003, 04:16 PM
How do I use "su"?
If I execute it in the shell I get a question for password. That is good, but how do I answer it from a script?
/Marcus
AdamGundry
06-10-2003, 10:05 AM
I would presume there is a command-line option to pass the password on the command. Try a Google search.
Adam
mf22cs
06-10-2003, 11:34 AM
Well, the "man" (man su) or the search for su(1) gives the answere that this is the proper synopsis.
su [options] [username] [arguments]
Anyone who knows if I can pass the password along in the arguments?
I tried "-c"-option, but that just passed it on to the first prompt appearing after the password prompt.
/Marcus