Fro a écrit :
Hi,
the operating system (Unix) considers a php-server as a user with name
"nobody". For example, if my php-script saves a file uploaded by a
user, the owner of the file will be "nobody". I would like to know if
"nobody" is considered as "group" or "others" (in terms of the "chmod"
command)? In other words, is "chmod g+w dirname" sufficient to allow
to "nobody" to write in the directory "dirname" or should I use "chmod
o+w dirname"?
Thank you.
Usually, "nobody" user is set with "nogroup" group. Those are 2
differents things, "nobody" can't be considered as group, but nobody's
group ("nogroup" in my case) can.
"nobody" is a user, thus :
- if a file does belong to myname:myname, nobody is just an "other"
- if it's myname:nogroup, nobody has group access to the file *because*
his group is nogroup
- and nobody:myname or nobody:nogroup gives him access as the file owner.
The very best option to give write access to a folder which rights you
can modify then is to chgrp nogroup (or chown myname:nogroup), and then
chmod g+w that directory. Thus the owner ("myname") will still have his
user access, the webserver (and php) group access , and any other user
won't have any access.
Hope it's clearer... re-reading myself, I'm not sure :p
--
Guillaume