User Tools

Site Tools



User and Group Permissions


Files in linx or *nix systems have user and group permissions

mic-2:tmp michaelc$ ls -la
total 16
drwxr-xr-x   5 michaelc  wheel   170 23 Oct 20:00 .
drwxr-xr-x  35 michaelc  wheel  1190 23 Oct 20:00 ..
-rw-r--r--   1 michaelc  wheel     2 23 Oct 20:00 anotherfile
drwxr-xr-x   2 michaelc  wheel    68 23 Oct 20:00 somedirectory
-rw-r--r--   1 michaelc  wheel     2 23 Oct 20:00 somefile

Above is an example of a full directory list all view. Notice the my user is michaelc and the group is wheel

User and group permissions in linux can often be confusing.

But lets try and understand how groups can help us…


  • Apache web service runs as user apache and group apache.
  • Your developers deploy their web content as user dreamteam and group dreamteam.

Problem arises that the developers need to allow a cache directory to be writable by apache. How do they do this?

The answer is groups

To allow user dreamteam to change any of its directories to be accessible by apache, user dreamteam must have sufficient rights and this is possible by making dreamteam a member of the group apache.

Make user dreamteam a member of the group apache

/usr/sbin/usermod -G apache dreamteam

Now dreamteam has the ability to make any of its directories writable for apache by changing the directory's group permission to be apache

chgrp apache <directory name>
guides/unix_admin/user_and_group_permissions.txt · Last modified: 2009/10/23 20:07 by michaelc