LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-10-2002, 04:15 PM   #1
The Jesus
Member
 
Registered: Mar 2002
Location: Cleveland, Ohio
Distribution: Ubuntu, Gentoo, Fedora Core 5, FreeBSD
Posts: 50

Rep: Reputation: 15
Question Excecuting script as different user...


I am trying to run a script that creates directories for our email system. I need the directories to be owned by Apache. When I run the script as root it sets the ownership of all the files and directories root. Is there a way to specify all of the directories to be apache when run from any user? Or is there a way to run a script as a different user than the one that I am currently logged in as? Thanks.
 
Old 04-10-2002, 10:16 PM   #2
kibble
LQ Newbie
 
Registered: Apr 2002
Posts: 14

Rep: Reputation: 1
It's unlikey you have it set so the apache user can create the directories in the first place. However 'su apacheuser -e script' will do that. What I would suggest is after all the directories are created is to use chown to change them to the apache user. Assuming you want /var/www and all the directories under it to be owned by the apache user 'web' do chown web -R /var/www
 
Old 04-13-2002, 03:50 PM   #3
kervin
Member
 
Registered: Jan 2002
Location: Melbourne, FL.
Distribution: redhat
Posts: 168

Rep: Reputation: 31
are you sure you want ot give apache user read access to your email directories?

What would happen if someone found a way to "confuse" your script? They'd be able to read everyone's mail.

What are you trying to do? A webmail frontend? Try http://www.squirrelmail.org/ .
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
User Login script? mkim Linux - Software 2 10-21-2005 05:13 PM
how do I make sure that the user that is going to run the script is a root user??? nikold01 Linux - General 3 09-10-2004 07:54 AM
User access script mrhyde Linux - Security 9 04-18-2004 02:52 AM
user script haggertus Linux - Newbie 4 10-30-2003 02:26 PM
shell script user not ok slam Linux - General 4 07-24-2003 06:40 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration