Wednesday, September 5, 2012

LINUX: Setting permissions for user on directory

To give a user full read and write access to the directory, its sub-directories and all files under that directory, there are two useful commands:
chown -R username directory
chmod -R u+rX directory
First command makes specified user owner of the directory, second command allows user full read and write access. The r in the command allows read access, X gives "execute" right to the directories. In order to give "execute" right to all the files, x should be used (case sensitivity); however, the later option is commonly not recommended.

No comments:

Post a Comment