Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
add comment

1 Answer 1

up vote 3 down vote accepted

This is very easy in POSIX based systems.

First

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
add comment

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.