Jump to content

Chmod 777

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
dirkfirst

dirkfirst

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 354 posts
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?

#2
Guest_Jordan_*

Guest_Jordan_*
  • Guests
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.

#3
RobSoftware

RobSoftware

    Programmer

  • Members
  • PipPipPipPip
  • 143 posts
Nice post Mr. Admin. He summed it up fairly well. Post back if you need any more help.