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.


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.

  • 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 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.