Solved

Linux group permissions

Posted on 2011-02-25
13
504 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
ID: 34986125
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
ID: 34986135
Tnx for the quick response.

Tried adding g+rwx but no joy.

Capt
0
 
LVL 12

Expert Comment

by:upanwar
ID: 34986168
Could you please give output of ls -la for Maildir and its content.
0
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 

Author Comment

by:Glen Gibb
ID: 34986200
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
ID: 34986206
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
ID: 34986262
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
 

Author Comment

by:Glen Gibb
ID: 34986284
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
ID: 34986366
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
ID: 34986461
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
ID: 34988618
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
ID: 34988696
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
ID: 34988761
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
ID: 34989037
Great help.  I'd like a bit of info on how you spotted the root:root situation.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VMware Workstation 12 Player 16 71
centos linux 65 123
WHM Debug Email Non-Send/Receipt 3 11
Migration Exchange server 2013 to 2016 2 26
Resolve Outlook connectivity issues after moving mailbox to new Exchange 2016 server
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
In this video we show how to create an email address policy 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 Mail Flow…
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…

813 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

16 Experts available now in Live!

Get 1:1 Help Now