How can I set full permissions to a user in a specified dir in linux?


Depends what you mean 'full permissions'. If you want a user to have full read and write access to all files and directories in that directory, then this will help:

chown -R username directory
chmod -R u+rX directory

The first command makes the user own the directory. The second command gives them full read and access permissions. The r gives read permission, the X gives 'execute' permission to directories, and not files.

  • The problem with setting the permission that way is you make every file executable which may not necessarily be a good idea. Generally speaking in less you know what files you're dealing with(or you just don't care) I wouldn't apply permissions to a whole directory tree this way. – einstiien Jan 22 '10 at 23:32
  • 1
    Nope, that doesn't set all files executable, it will only set the directories 'executable'. That's the difference between x and X. – Rory Jan 22 '10 at 23:50
  • Sorry, didn't see the capital. – einstiien Jan 23 '10 at 9:30

The two solutions previous to my comment assume that you only want a SINGLE person to have full access to a directory and its sub-directories and files below it.

Is that correct or do you want MULTIPLE people to have full access to that specific directory?


If you do not wish to change the existing permissions of the directory, yet would like to give a user (or multiple users or groups) permissions to the contents of the directory, you can use ACLs. Some filesystems (ext3) require the acl flag on mount to enable ACLs. Often, just using groups is sufficient, but ACLs can be more flexible.

Look at the setfacl and getfacl commands for more information.


You can give the user ownership with the following command:
chown -R username:groupname directory

Permissions are controlled with chmod but more than likely if you give the user ownership the permissions should already be set to give them full access.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.