[SOLVED] permissions on a new mount

General support questions

[SOLVED] permissions on a new mount

Postby NickC » 2012/05/13 14:29:20

Having a bit of trouble creating a new volume, mounting it and then sharing it via Samba. The problem seems to be with permissions.

I start by adding a LVM physical volume, logical volume group and logical volume - device: /dev/dm-3, label: Data1.

Then use webmin to mount this as /Data1 with the option Allow users to mount this file system: Yes.

Permissions from a terminal:
ls -l /Data1 - drwx------ root root

but permissions from Nautilus:
Owner: Nick
Folder access: Create and delete files
File access: ---
Group: Nick & Users
Folder access: none
File access: ---
Others
Folder access: none
File access: ---

Any idea why these are both reporting different owner & permissions. More importantly how do I make this directory/mount point available read/write to all users.

Thanks,
Nick
NickC
 
Posts: 109
Joined: 2012/01/20 16:13:41

[SOLVED] permissions on a new mount

Postby pschaff » 2012/05/13 17:10:43

Likely multiple issues there. First the existing permissions are 700 - root rwx. If you really want world rwx (not necessarily a good idea) then
Code: Select all
chmod 777 /Data1

You may also need to set the SELinux context. A forum search on SELinux Samba should turn up some clues.
pschaff
Retired Moderator
 
Posts: 18277
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America

Re: permissions on a new mount

Postby NickC » 2012/05/13 19:11:47

Thanks for that Phil.

I have now done:

chmod 775 /Data1
chown :users /Data1
Webmin -> Create file share /Data, options: group: users, permissions: 775
setenforce 0

I have no idea what an SELinux context is and couldn't find much by searching 'SELinux Samba' so have switched that off completely for the moment. Can SELinux be uninstalled or at least permanently disabled somehow so that I don't have to keep doing setenforce 0 everytime I reboot the machine.


Nick
NickC
 
Posts: 109
Joined: 2012/01/20 16:13:41

Re: permissions on a new mount

Postby pschaff » 2012/05/14 00:07:14

If you really want to throw away one of the major security features of an Enterprise Linux distro, rather than taking time learn how to deal with it, it can be done. If you had read a sufficient number of the results from the search they would have led you to things like:
http://wiki.centos.org/HowTos/SetUpSamba
http://wiki.centos.org/HowTos/SELinux
http://wiki.centos.org/TipsAndTricks/SelinuxBooleans

and/or posts like this or this.

If still determined to run in permissive mode, or worse yet to disable SELinux altogether, then see /etc/sysconfig/selinux and the method should become obvious.
pschaff
Retired Moderator
 
Posts: 18277
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America

Re: permissions on a new mount

Postby NickC » 2012/05/14 15:07:00

Brilliant thanks Phil all working fine now. The answer for the acrchives and anyone reading this in the future:
semanage fcontext -a -t samba_share_t '/Data1(/.*)?'
restorecon -R /Data1

Cheers,
Nick
NickC
 
Posts: 109
Joined: 2012/01/20 16:13:41

Re: [SOLVED] permissions on a new mount

Postby pschaff » 2012/05/14 15:18:23

Glad to hear of your success. Thanks for reporting back. Marking this thread [SOLVED] for posterity.
pschaff
Retired Moderator
 
Posts: 18277
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America


Return to CentOS 6 - General Support

Who is online

Users browsing this forum: No registered users and 14 guests