Solved

Linux group permissions

Posted on 2011-02-25
13
502 Views
Last Modified: 2012-05-11
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
0
Comment
Question by:Glen Gibb
  • 7
  • 6
13 Comments
 
LVL 12

Expert Comment

by:upanwar
Comment Utility
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
 

Author Comment

by:Glen Gibb
Comment Utility
Tnx for the quick response.

Tried adding g+rwx but no joy.

Capt
0
 
LVL 12

Expert Comment

by:upanwar
Comment Utility
Could you please give output of ls -la for Maildir and its content.
0
 

Author Comment

by:Glen Gibb
Comment Utility
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
 

Author Comment

by:Glen Gibb
Comment Utility
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
 
LVL 12

Expert Comment

by:upanwar
Comment Utility
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
Don't lose your head updating email signatures!

Do your end users still have the wrong email signature? Do email signature updates bore you or fill you with a sense of dread? You can make this a whole lot easier on yourself by trusting an Exclaimer email signature management solution. Over 50 million users do...so should you!

 

Author Comment

by:Glen Gibb
Comment Utility
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
 
LVL 12

Expert Comment

by:upanwar
Comment Utility
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
 
LVL 12

Expert Comment

by:upanwar
Comment Utility
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
 

Author Comment

by:Glen Gibb
Comment Utility
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
 
LVL 12

Accepted Solution

by:
upanwar earned 500 total points
Comment Utility
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
 

Author Comment

by:Glen Gibb
Comment Utility
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
 

Author Closing Comment

by:Glen Gibb
Comment Utility
Great help.  I'd like a bit of info on how you spotted the root:root situation.
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

Email signatures have numerous marketing benefits. Here are 8 top reasons to turn your email signature into a marketing channel.
This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
In this video we show how to create a Resource Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: Navigate to the Recipients >> Resources tab.: "Recipients" is our default selection …
In this video we show how to create an Address List in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Organization >> Ad…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now