469,623 Members | 1,535 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,623 developers. It's quick & easy.

Does "nobody" is considered as group-member of others?

Fro
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.
Feb 28 '08 #1
4 2548
In our last episode,
<ec**********************************@j28g2000hsj. googlegroups.com>, the
lovely and talented Fro broadcast on comp.lang.php:
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"?
Usually 'nobody' is the least priviledged user (and is forbidden to login).

Thus, 'nobody' is an 'others' and should not be added to any other group.

--
Lars Eighner <http://larseighner.com/us****@larseighner.com
Countdown: 327 days to go.
Feb 28 '08 #2
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
Feb 28 '08 #3
Guillaume a écrit :
Usually, "nobody" user is set with "nogroup" group.
My bad btw, it's right that there also are many distribs with
nobody:nobody. But the point is still there :p

--
Guillaume
Feb 28 '08 #4
Fro wrote:
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.
Why aren't you asking this in a Unix newsgroup? It has absolutely
nothing to do with PHP.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Feb 28 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Askari | last post: by
24 posts views Thread by AES/newspost | last post: by
134 posts views Thread by James A. Donald | last post: by
4 posts views Thread by Jason | last post: by
65 posts views Thread by Aditya | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.