Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Can you explain briefly the main concepts and command line tools used to manage file permissions?

share|improve this question

2 Answers

up vote 13 down vote accepted

Each file has rights for three different categories:

  • the owner of the file,
  • the group associated with the file, and
  • everybody else.

Rights mean the right to read the file, the right to write to the file, or the right to execute the file in case of a script or program.

On the CLI, you may

  • change the owner with chown, e.g. chown guillermooo
  • change the group with chgrp, e.g. chgrp root
  • change the rights with chmod, e.g. chmod u+w filename.ext (Adds writing permission for the owner of the file filename.ext)

If you'd like to know more about each of these tools, open a terminal and type man [tool], e.g. man chmod.

share|improve this answer
4  
It's a little more tricky with directories - execute permission is required to access the directory's contents. This means (for example) to read or write a file you need execute access to the directory containing it as well as the appropriate permissions on the file itself. This almost never comes up, but that's why it is poorly documented/understood! – adamnfish Aug 3 '10 at 21:59
Huh. You're right. I'll edit it in tomorrow, when I'm less sleepy. – ParanoiaPuppy Aug 4 '10 at 20:24

Here's a nice tutorial on it: http://www.elated.com/articles/understanding-permissions/

share|improve this answer

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.