Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-21-2010, 07:07 PM   #1
Registered: Sep 2005
Distribution: fedora core 9
Posts: 324

Rep: Reputation: 33
PHP: restrict script to one dir & and to one user


1-Can I do su - userA in php? Cam I have php run the whole script as userA.

2-Can I make php to run from a certain directory? like chroot kind of things.

Old 01-21-2010, 09:44 PM   #2
Senior Member
Registered: Dec 2004
Posts: 1,056

Rep: Reputation: 78
for #2, you may find these functions useful. You can chdir or chroot if you like.

For #1, that's more tricky. The php docs on exec have some this one:
exec("echo 'apache' | /usr/bin/sudo -u mail -S /var/www/html/ $name");


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
logoff script remove home DIR & user profile sportivo888 Linux - Newbie 3 12-09-2007 03:30 AM
Restrict SSH to Group & User Hammad101 Linux - Security 2 10-16-2007 08:12 AM
php script & sudo rblampain Programming 3 05-13-2006 08:03 PM
"how should we restrict the samba user with respect to particular dir" sreedhara Red Hat 1 04-06-2006 02:10 PM
PHP Script & LDAP zael Programming 1 07-29-2004 04:37 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:18 PM.

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