Flexible Use of ACL to set Samba sharing permissions (user1 can be read and written, user2 can be read and not written, user3 can be written and unreadable, user4 can only see sharing !)

Source: Internet
Author: User

1. Edit the samba configuration file (Vim/etc/samba/smb. conf)

Take the shared idea directory as an example!

[Region]

Comment = comment

Path =/Signature

Writable = Yes

Create mask = 1606

Directory mask = 1606

Read list = user2

2. Enable Linux to support posix acl (this posix acl function is officially supported on Linux kernel 2.6 and laterBack-Port
To 2.4 kernel. ACL can be used in common file systems, such as ext3, XFS, JFS, and reiserfs. Of course, you must start the ACL when compiling the kernel .)

Edit/etc/fstab

Add a row:

/Dev/sda1/home ext3 ACL 1 2

Restart!

3. Compile a small script

#! /Bin/bash

Mkdir plugin

Chmod 077/clusters

Chown user4.user4/login

Chmod o + T/second

Setfacl-m d: U: user1: rwx/logs

Setfacl-m d: U: user2: R/role

Setfacl-m d: U: user3: W/Example

Run the script and restart SMB!

Remember to turn off the firewall !!!

If you are interested in posix acl, see http://jianghuo495593541.download.csdn.net

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.