Take the 2-minute tour ×

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
add comment

3 Answers

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
add comment

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
add comment

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
add comment

Your Answer


