How PAM implements Samba access control for users and hosts

Source: Internet
Author: User
Article title: PAM implements Samba access control for users and hosts. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

PAM (Pluggable Authentication Module) is a very effective tool for host and user access control. Samba3.0 has already been well integrated with PAM. With the powerful and flexible authentication mechanism of PAM, you can control access to users and hosts at the same time.

A Samba server has a shared directory/var/myAREA. you want st02 to access this shared segment on any host in the network segment 192.168.1.0/24, however, you cannot access the shared segment on any host in the network segment 192.168.1.0/24.

(1) edit the smb. conf configuration file to support PAM authentication and configure the shared segment myAREA

[Global]

......

Obey restrictions = yes

[MyAREA]

Path =/var/myAREA

(2) edit the configuration file/etc/pad. d/samba to add an access control file.

Add the following statement before the first accout command:

Account required pam_access.so accessfile =/etc/mysmblogin

(3) Create a custom Samba access control file/etc/mysmblogin

Vi/etc/mysmblogin

The content is as follows:

+: St02: 192.168.1.

-: Update: 192.168.1.

Restart the samba service and test.

The above experiment was successfully passed under RedHatAS4 and AS5, hoping to help you in your practical work.

Related Article

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.