Linux group permissions

Experts,

I am setting up a Maildir for a mail server on Ubuntu 10.10.

I have given rw permissions to a group called Mail, and assigned myself to that group.

I cannot read the mail because "permission denied" on the folder.

I think I have access because I am part of that group.  What gives?

Capt
Glen GibbOwnerAsked:
Who is Participating?
 
upanwarCommented:
The output of chmod command shiws that permission has been changed but your earlier output for listing shows that only owner can do rwx with dir/files.

Owner and group for the listed content was root:root so you may change the group also to achiev your goal.

But I would prefer the ACL.


0
 
upanwarCommented:
To get the access into the directory you need to give executable permission also to the group. Without executable permission we can not enter into the directory.

give rwx to the group.

0
 
Glen GibbOwnerAuthor Commented:
Tnx for the quick response.

Tried adding g+rwx but no joy.

Capt
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
upanwarCommented:
Could you please give output of ls -la for Maildir and its content.
0
 
Glen GibbOwnerAuthor Commented:
Could not cd into /var/mail.  

Here's the content of "ls -la" for "var"
drwsrws---  2 root mail  4096 2011-02-25 23:43 mail

Capt
0
 
Glen GibbOwnerAuthor Commented:
Whoops.  Logged in as root.  Here's Maildir:

drwx------  5 root root 4096 2011-02-25 22:57 .
drwx------ 12 root root 4096 2011-02-26 00:59 ..
drwx------  2 root root 4096 2011-02-25 22:57 cur
drwx------  2 root root 4096 2011-02-25 23:30 new
drwx------  2 root root 4096 2011-02-25 23:30 tmp

Capt
0
 
upanwarCommented:
1. In your first post you have mentioned that you have added your user to group called Mail but output of /var/mail shows that the group name is mail instead of Mail.

Please give output of below given command.

groups <username>

2. Maildir's output shows that all the contents under that directory are having permission user and group root and the group is not having any rights, only the user root have rights to read write and execute.

3. Please confirm that your Maildir is /var/mail or anything else.
0
 
Glen GibbOwnerAuthor Commented:
You are correct.  The group is actually "mail", not "Mail".  I belong to the small m group (as evidenced by the output requested in #1 above.

Maildir is "/var/mail" as you asked in #3 above.

If the group has no rights, what is happening to my command, "sudo chmod  -R g+rwx /var/mail"?  Is that not setting read, write and execute for the group, "mail"?

Capt
0
 
upanwarCommented:
command, "sudo chmod  -R g+rwx /var/mail" should change the permission for group to rwx recursively. Could you please try the below given command to see what exactly happening to your command.

sudo chmod  -Rv g+rwx /var/mail

0
 
upanwarCommented:
Group is also needs to be changed from root to mail for the content inside Maildir to get permission.

Or you can set ACL to achive this goal.

http://www.yolinux.com/TUTORIALS/LinuxTutorialManagingGroups.html
0
 
Glen GibbOwnerAuthor Commented:
Here's the result of the chmod (verbose):

mode of `/var/mail' retained as 6770 (rwsrws---)
mode of `/var/mail/nobody' retained as 0770 (rwxrwx---)
mode of `/var/mail/sales' retained as 0770 (rwxrwx---)
mode of `/var/mail/glen' retained as 0770 (rwxrwx---)

I'll try the tutorial.

Capt
0
 
Glen GibbOwnerAuthor Commented:
You've been terrific, upanwar.  Thanks for your help.

Could you give me a quick explanation of how you saw that only the owner can rwx the folder and files?

Capt
0
 
Glen GibbOwnerAuthor Commented:
Great help.  I'd like a bit of info on how you spotted the root:root situation.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.