To chmod or not to chmod

posted: Thursday 01 April 2010 by Tavis J. Hampton in: Web Hosting Web servers

Chmod commands in Linux

When installing scripts on a server, there is a tendency of both developers (in their instructions) and users to be overly generous in dishing out file permissions. In Linux, file permissions can be manipulated with the “chmod” command.

For example, a script may require write access to a temporary directory, and the instructions may call for you to chmod the directory 777. What this means is that anyone can read, write, and execute commands to the directory, including complete strangers. While such permissions might be necessary for a public repository, they are not for most web-based scenarios.

If the server or a particular authenticated user needs write access for a directory, chmod it 664. This means that the owner and the user group will be able to write to that directory, but others will only be able to read its contents. If you ever need something to be completely locked down and not readable by the outside world, make the last digit a “0″. Stay tuned to this blog for more chmodding tips in the future.

Photo Source: Flickr

1 stelle2 stelle3 stelle4 stelle5 stelle (no votes)
share this 0 comments

Be the first to add a comment to this article.

Your email address is required but won't be displayed.
Leave a comment

Register to reserve your nickname accross all the blogs in the Blogo network and to upload your avatar. If you already are registered, login to user your nickname.

Yes No

Comment preview

Network Blogo