Webhosting project: Ristricting users to access only their folder

Discussion in 'PHP' started by siber, May 12, 2009.

  1. #1
    Hi

    I am working on a web hosting project. Need advice to deal with some security issues:

    Listed below are the settings:

    (a) Host name is “comp1.com”
    (b) Web server is Apache.
    (c) I have a folder name “webhosting”. This is in the “/” folder. So the path is “/webhosting”
    (d) In the /webhosting folder there are three folders, for three different users:
    (1) /webhosting/user1
    (2) /webhosting/user2
    (3) /webhosting/user3
    (e) I have three users : user1, user2 and user3
    (e) There is a control panel written in php via which customers can upload files to their respective folders. They are restricted to upload the files only to their folders

    Now, this is my doubt/question:

    Since the files will be uploaded via php, the file owner of all files under “/webhosting” will be Apache.

    (a) If “user3” write a php code to lists all files under “/webhosting” and uploads it in to his directory, won’t he be able to see all files under “/webhosting” when he executed the script?
    (b) Since this is a major security concern how could we avoid it by restricting the user’s php code to access files only in his directory? In this case “/webhosting/user3” is the user3’s directory.

    Thanks,
    Siber
     
    siber, May 12, 2009 IP
  2. siber

    siber Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Got the answer I was looking for in:

    http://articles.techrepublic.com.com/5100-10878_11-5272345.html?tag=rbxccnbtr1

    Regards,
    Siber
     
    siber, May 12, 2009 IP