Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I encountered an option for chmod:

chmod 777 /tyr/....

What is 777 for?

share|improve this question
3  
Do be aware that 777 is almost always wrong and a potential security risk. –  Daenyth Aug 4 '10 at 15:49
    
how can I use it in safe side? –  user44509 Aug 4 '10 at 15:50

2 Answers 2

up vote 7 down vote accepted

The world, the file's group, and the file's owner can read, write, and execute the file. The 777 specifies that using octal notation.

For further reading - http://en.wikipedia.org/wiki/File_system_permissions#Octal_notation

share|improve this answer
    
do you mean for User Group and Other? –  user44509 Aug 4 '10 at 15:49
    
Yes, that's what I meant. –  dsolimano Aug 4 '10 at 15:52

The octal permission 777 is equivalent to the symbolic permission ugo=rwx or as you would see it using ls -l:

rwxrwxrwx 1 user group 25500 2010-08-01 06:44 filename

Usually, you don't want the world (Other) to be able to write to a file.

For example, if a file is writeable by Other and executable by all (ugo+x) then some malicious user could change the file and it might have dire consequences the next time it's run.

Usually, for executables, 755 is sufficient. For other files, 644 is usually plenty, but sometimes they need to be group writeable (664) or readonly (444) or for the most privacy (400 or 600).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.