linux user permissions with groups on file

Posted on

Problem :

I have one file owned by user: “ruler”

and another user: “tzook”

now I have one file that is owned by “ruler” and by group “deployers”

here is the file:

-rwxrwxr-- 1 ruler deployers 3040 Oct 28 12:53

now when I am the user ruler there is no problem editing, viewing etc

but when I am user “tzook”
that the output of –>

$ tzook sudo www-data ruler deployers


tzook sudo www-data ruler deployers

so you can see the user tzook is in the group “deployers”
so why cant I edit or view the file?

I get “permission denied” when I use:

 $ ls -la

Solution :

Make sure you have execute permissions in the directory.

Check your permissions by:

ls -ld .

If the directory is not owned by group ‘deployers’, chgrp it:

chgrp deployers .

Then give the group permissions read/execute permissions:

chmod g+rx .

Leave a Reply

Your email address will not be published. Required fields are marked *