Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I seem to have a problem when trying to set permissions for my files since I try to set some permissions for my folders on the server.

I've tried setting the permissions to 666 but I can still be able to view the files in the directory I access to. When I check the permission again, it says it's 766.

I have some folders that some of my scripts copy files to, so what chmod number will I need in order for some files to be copied/written to without showing the files to users.

share|improve this question

3 Answers 3

up vote 2 down vote accepted

700 on a directory will allow you read/write access for yourself, and no access for group or other.

750 will allow full access for yourself, read-only access for the group, and no access for others.

share|improve this answer

You need to use -R with chmod command to change the permissions of the files inside a folder.

The appropriate mode of the folders for your script depends on the user that is running your script. If you are running the script as root, the following permissions will enable full access to your script and nothing to all other users.

Owner: root
Group: root
Mod: 700
share|improve this answer

Not meant offensive, but this helps me all the time to calculate ownerships:

user  group  others
rwx   rwx    rwx
421   421    421     = 0777 # the zero is for SUID, SGID and sticky bit

user  group  others
rwx   r-x    ---
421   401    000     = 0750 # the zero is for SUID, SGID and sticky bit
share|improve this answer
    
You could look into symbolic notation if you have a hard time remembering the numerical values. –  Aaron Copley Nov 4 '10 at 17:18

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.