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
[SOLVED] permissions on a new mount
-
- Retired Moderator
- Posts: 18276
- Joined: 2006/12/13 20:15:34
- Location: Tidewater, Virginia, North America
- Contact:
[SOLVED] permissions on a new mount
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]chmod 777 /Data1[/code]
You may also need to set the SELinux context. A forum search on [url=https://www.centos.org/search.php?query=selinux+samba&mid=30&action=showall&andor=AND]SELinux Samba[/url] should turn up some clues.
You may also need to set the SELinux context. A forum search on [url=https://www.centos.org/search.php?query=selinux+samba&mid=30&action=showall&andor=AND]SELinux Samba[/url] should turn up some clues.
Re: permissions on a new mount
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
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
-
- Retired Moderator
- Posts: 18276
- Joined: 2006/12/13 20:15:34
- Location: Tidewater, Virginia, North America
- Contact:
Re: permissions on a new mount
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 [url=https://www.centos.org/modules/newbb/viewtopic.php?topic_id=36035&forum=56&post_id=156385#forumpost156385]this[/url] or [url=https://www.centos.org/modules/newbb/viewtopic.php?topic_id=34958&forum=56&post_id=150449#forumpost150449]this[/url].
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.
http://wiki.centos.org/HowTos/SetUpSamba
http://wiki.centos.org/HowTos/SELinux
http://wiki.centos.org/TipsAndTricks/SelinuxBooleans
and/or posts like [url=https://www.centos.org/modules/newbb/viewtopic.php?topic_id=36035&forum=56&post_id=156385#forumpost156385]this[/url] or [url=https://www.centos.org/modules/newbb/viewtopic.php?topic_id=34958&forum=56&post_id=150449#forumpost150449]this[/url].
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.
Re: permissions on a new mount
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
semanage fcontext -a -t samba_share_t '/Data1(/.*)?'
restorecon -R /Data1
Cheers,
Nick
-
- Retired Moderator
- Posts: 18276
- Joined: 2006/12/13 20:15:34
- Location: Tidewater, Virginia, North America
- Contact:
Re: [SOLVED] permissions on a new mount
Glad to hear of your success. Thanks for reporting back. Marking this thread [SOLVED] for posterity.