The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

repquota -a|grep ^nobody

Discussion in 'General Discussion' started by XPerties, Jul 23, 2003.

  1. XPerties

    XPerties Well-Known Member

    Joined:
    Apr 10, 2003
    Messages:
    401
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    New Jersey, USA
    Darren at cpanel told me the following:

    Any user that uploads their files using php scripts (php scripts run as the same user apache runs as, nobody) the files will be owned by the user nobody. You can keep an eye on how much space that user is using the following command

    repquota -a|grep ^nobody

    but how do you track where the nobody files are? I get this when I run the command above:

    nobody -- 147668 0 0 6489 0 0



    also after Ive done that and he told me I can chown the public_html for each user. What is the command I use....? Is it:

    cd /home/USERNAME/public_html/
    chown -R USERNAME:USERNAME ./

    Will that chown everything in the public_html and below? So that the user will have a correct storage output?

    cPanel.net Support Ticket Number:
     
  2. Tim Greer

    Tim Greer Well-Known Member

    Joined:
    Aug 11, 2002
    Messages:
    62
    Likes Received:
    0
    Trophy Points:
    6
    find /home/username \( -user nobody -o -group nobody \) -exec chown username.username {} \;

    This could be automated to make your life easier. Also, you should change any of those files permissions as well (to 777), so it doesn't break anyone's scripts when the 'nobody' user can't write to them any longer.
     
  3. Tim Greer

    Tim Greer Well-Known Member

    Joined:
    Aug 11, 2002
    Messages:
    62
    Likes Received:
    0
    Trophy Points:
    6
    PS: If you use PHP/SuEXEC, though it will have more overhead and be slower, you can control and limit the resources each vhost can use, have better security, better tracking of spam and abuse via scripts, as well as no longer worry about the quotas issues, since all CGI/PHP generated files will then be owned by the user and not the global web server user.

    cPanel.net Support Ticket Number:
     
  4. XPerties

    XPerties Well-Known Member

    Joined:
    Apr 10, 2003
    Messages:
    401
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    New Jersey, USA
    just to clearify this is the command I run in SSH?

    find /home/username \( -user nobody -o -group nobody \) -exec chown username.username {} \;

    and this will chown all nobody files to the user it is under?

    if so how would I then change the permission if it does it auto? A little confused here sorry.

    cPanel.net Support Ticket Number:
     
  5. Tim Greer

    Tim Greer Well-Known Member

    Joined:
    Aug 11, 2002
    Messages:
    62
    Likes Received:
    0
    Trophy Points:
    6
    Yes, that is correct.

    find /home/username \( -user nobody -o -group nobody \) -exec chown username.username {} \; -exec chmod 777 {} \;
     
  6. XPerties

    XPerties Well-Known Member

    Joined:
    Apr 10, 2003
    Messages:
    401
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    New Jersey, USA
    now just a quick thought. Is there anyway system files can be owned by nobody. Thinking changing permission to 777 for system files might not be a good idea.:D

    cPanel.net Support Ticket Number:
     
  7. Tim Greer

    Tim Greer Well-Known Member

    Joined:
    Aug 11, 2002
    Messages:
    62
    Likes Received:
    0
    Trophy Points:
    6
    Firstly, this isn't automated to pick up each user and will change each of them--this example is for each user seperately, manually. This could easily be automated with some shell scripting on the command line, or via a shell or Perl (or anything else) script.

    As for system files owned by nobody--I hope not, or you have bigger problems than you know. :) Not only will there not be system files in the user's public_html directory, but if files were owned by the nobody user, anyone could run a CGI or PHP script and have that script modify that file in question then anyway.
     
  8. ciphervendor

    ciphervendor Well-Known Member

    Joined:
    Aug 26, 2002
    Messages:
    1,052
    Likes Received:
    0
    Trophy Points:
    36
    You might want to take a moment to read & understand the command Tim has recommended you execute. The command doesn't just arbitrarily change permissions & ownership on files; you need to direct it to the correct path.

    cPanel.net Support Ticket Number:
     
  9. XPerties

    XPerties Well-Known Member

    Joined:
    Apr 10, 2003
    Messages:
    401
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    New Jersey, USA
    ahhh got yah...

    find /home/username will only search in that directory and below.

    I was not understanding the command as ciphervendor pointed out.

    Thanks again guys.

    cPanel.net Support Ticket Number:
     
Loading...

Share This Page