05 October, 2010

Changing Permissions with chmod

The chmod command lets you change the access permissions of files and directories. shows several chmod command lines and how access to the directory or file changes.

chmod 0700

The directory’s owner can read or write files in that directory as well as change to it. All other users (except root) have no access.

chmod 0711 
Same as for the owner. All others can change to the directory, but not view or change files in the directory. This can be useful for server hardening, where you prevent someone from
listing directory contents, but allow access to a file in the directory if someone already knows it’s there.

chmod go+r

Adding read permission to a directory may not give desired results. Without execute on, others can’t view the contents of any files in that directory.

chmod 0777

All permissions are wide open.

chmod 0000

All permissions are closed. Good to protect a directory from errant changes. However, backup programs that run as non-root may fail to back up the directory’s contents.

chmod 666

Open read/write permissions completely on a file.

chmod go-rw Don’t let anyone except the owner view, change, or delete the file.

chmod 644

Only the owner can change or delete the file, but all can view it.

0 comments:

Post a Comment

speak out... itz your time !!!

 

Terminal Diary | techblog Copyright © 2009 Gadget Blog is Designed by jintu jacob Powered by Blogger