Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run script as authenticated user

Status
Not open for further replies.

Crundy

Programmer
Jul 20, 2001
305
GB
Hi all,
I need to make a perl application that will allow users to log on using basic authentication, and will then create configuration files in their home directories. I've looked at suEXEC, but that only seems to be useful if you predefine which user you want the script to run as. Is there any way to get a script to run as the currently authenticated user?

C:\DOS:>
C:\DOS:>RUN
RUN DOS RUN!!
 
It sounds like you can do what you're wanting with suexec. suexec tells apache to run as whatever username owns a particular home directory. I don't know if you're talking about running this on Linux or not, but I'll assume Linux... For example, let's say you have a home directory for a user named "foo". In /etc/passwd, "foo" has a home directory defined as /home/foo. Any scripts found under /home/foo will run as the user "foo". New files created by the script will be created with "foo" as the owner. Under these conditions, you can run a script with rwx for the owner and --- for group and other. This is very good security for your system, and it helps with FTP issues as well.

Is this what you're wanting to do?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top