Home » Infrastructure » Unix » Scripting problem
Scripting problem [message #97125] Sun, 16 December 2001 09:35 Go to next message
Messages: 1
Registered: December 2001
Junior Member

Im trying to get a script, which runs as the user who owns it, to run either as a different user, or to run as root. Yes I am aware of the security implications of this, but I need to script to write to a file from the web, thats owned differently.

How do I do that?

Re: Scripting problem [message #97129 is a reply to message #97125] Mon, 17 December 2001 06:06 Go to previous message
Messages: 182
Registered: April 1998
Senior Member
You can use the su -c Unix command (runs as user_name).

# This script Will run 2 commands as another user
su -c user_name "(echo 'Command1';echo 'Done')"

Previous Topic: get number of bytes
Next Topic: Re: Scripting problem
Goto Forum:

Current Time: Tue May 21 05:34:52 CDT 2024