I don't really understand what CHMOD does but I have a whole directory that is 777. I understand this is world?? :eek:
Is this safe? Can anyone lead me to more information?
I use this in a PHP script I installed. What are the reasons for 777?
Chmod 777
Started by dirkfirst, May 25 2006 03:33 PM
2 replies to this topic
#1
Posted 25 May 2006 - 03:33 PM
|
|
|
#2
Guest_Jordan_*
Posted 12 June 2006 - 02:17 PM
Guest_Jordan_*
chmod 777 is world access. That means that anyone can access/modify/execute your script.
the first 7 is USER (you are the user)
the second 7 is GROUP (anyone in your group)
the third 7 is OTHER (anyone not you or in your group)
These can also be expressed as RWX for each one such as when you do a ls -la
-rwxrwxrwx
Read/Write/Execute is what RWX stand for
The first - is a - for files and d for directories.
r (Read) = 4
w (Write) = 2
x (Execute) = 1
So, if you add all of those numbers up it is a 7. Access to each command
chmod 700 filename = rwx for user
chmod 600 filename = rw for user
chmod 500 filename = rx for user
chmod 400 filename = r for user
chmod 200 filename = x for user
So, to get a combination of RWX for user/group/other you need to figure out which access you'd like to give each person.
For example:
chmod 755 filename = All (ugo) for User, read/execute for group and other.
chmod 751 filename = All (ugo) for User, read/execute for group, execute for other.
chmod 777 can be dangerous as anyone else on your sever can do whatever they like with that file that is chmoded 777. Sometimes you have to do it so that apache/php can modify and execute certain files or directories.
the first 7 is USER (you are the user)
the second 7 is GROUP (anyone in your group)
the third 7 is OTHER (anyone not you or in your group)
These can also be expressed as RWX for each one such as when you do a ls -la
-rwxrwxrwx
Read/Write/Execute is what RWX stand for
The first - is a - for files and d for directories.
r (Read) = 4
w (Write) = 2
x (Execute) = 1
So, if you add all of those numbers up it is a 7. Access to each command
chmod 700 filename = rwx for user
chmod 600 filename = rw for user
chmod 500 filename = rx for user
chmod 400 filename = r for user
chmod 200 filename = x for user
So, to get a combination of RWX for user/group/other you need to figure out which access you'd like to give each person.
For example:
chmod 755 filename = All (ugo) for User, read/execute for group and other.
chmod 751 filename = All (ugo) for User, read/execute for group, execute for other.
chmod 777 can be dangerous as anyone else on your sever can do whatever they like with that file that is chmoded 777. Sometimes you have to do it so that apache/php can modify and execute certain files or directories.
#3
Posted 14 June 2006 - 01:35 PM
Nice post Mr. Admin. He summed it up fairly well. Post back if you need any more help.


Sign In
Create Account


Back to top









