Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have created a file, admin, that I want to assign to a group, admingroup, and later on give a specific user, adminuser, exclusive access to that file but I have no idea how.

share|improve this question
up vote 4 down vote accepted

This is very easy in POSIX based systems.


chown adminuser:admingroup admin

That will make the owner of the file specificly adminuser and the entire group admingroup.

Then you will likely want to:

chmod a-rwx admin
chomd ug+rwx admin

That will remove all permissions from admin and then give user and group access to read write and execute the admin file.

This is a very decent tutorial on file permissions, though there are better ones. This should get you started though.

share|improve this answer
You could also run chmod o-rwx to just remove others abaility to read/write/execute, or use about a hundred other methods. Use ls -lah to view permissions on files. – coteyr Jan 21 '13 at 17:43

Your Answer


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.