'nobody', despite the odd sounding name, is a fully fledged regular user that lives in /etc/passwd like everyone else. Some systems have the Web server set to use a different user, such as 'www', but the principle is the same. Any files you create from a script running under a Web server are "owned" by the user the Web server is running as. On a typical system, this is 'nobody'. You might think that since you own the scripts they run as you, but this is not normally the case.

Since they are owned by a user, they can't be changed or altered by anyone but that user, or the admin, of course, unless you've granted other permissions. Be aware, though, that other script programs on the same server may be able to access and modify these files, even if these scripts aren't yours.

If you want to run the scripts as a real user, and not this 'nobody' account, you have to tell your Web server to do this explicitly. It is a bit more work to do since the Web server will have to do some special stuff to get your particular account activated for the purpose of running the script, but it is more secure.

Apache has a method called suEXEC which handles this. Setting it up properly can be a bit tricky, so be careful. From the documentation:
Used properly, this feature can reduce considerably the security risks involved with allowing users to develop and run private CGI or SSI programs. However, if suEXEC is improperly configured, it can cause any number of problems and possibly create new holes in your computer's security. If you aren't familiar with managing setuid root programs and the security issues they present, we highly recommend that you not consider using suEXEC.

In reply to Re: File Protections by tadman
in thread File Protections by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.