Samba Sharing for Linux experiments (password Authentication)

Source: Internet
Author: User

First, the experimental requirements

    1. There are three accounts smb1, SMB2, SMB3, all belonging to the Users group

    2. The Linux password for all three accounts is 1234,samba password 4321

    3. Samba Services share/home/project directory, resource share named Project

    4. Three accounts can use project resources, and members of the Users group have write access to project

    5. Each of the three accounts has its own home directory under Samba services

    6. Samba security is User level


Second, the server configuration

  1. Installation: Yum Install-y Samba

  2. Shut down firewall: Service iptables stop

  3. Set up three accounts: Useradd-g users SMB1

    Useradd-g Users SMB2

    Useradd-g Users SMB3

  4. Set up your account Linux password: Echo 1234 | passwd--stdin SMB1

    echo 1234 | passwd--stdin SMB2

    echo 1234 | passwd--stdin SMB3

  5. Create project folder: Mkdir/home/project

    Chgrp Users/home/project

    chmod 2770/home/project

    Ll-d/home/project

  6. Backup configuration file: Cp/etc/samba/smb.conf/etc/samba/smb.conf.bak

  7. Edit Profile: vim/etc/samba/smb.conf

    Security = User

[Homes]

Comment = Home Directory

browseable = No

writable = yes


[Project]

Comment = Samba Project

Path =/home/project

browseable = yes

writable = yes

Write list = @users


8. Verify the configuration: Testparm

9. Add Samba Account: pdbedit-a-u SMB1

Pdbedit-a-U SMB2

Pdbedit-a-U SMB3

10. View the new account: Pdbedit-l

11. Set the SELinux section:

Home directory permissions: Setsebool-p samba_enable_home_dirs on

Project directory permissions: Chcon-t samba_share_t/home/project/

12. Start Samba service:/ETC/INIT.D/SMB start

Chkconfig SMB on


Third, Windows Client Access

1. \\192.168.1.100, log in with SMB1, you can see the project and SMB1 home directory, in two folders can add/remove directories or files, under project create a new SMB1 folder

2. Log in with SMB2, you can see the home directory of Project and SMB2, can add/remove directories or files in two folders, SMB2 can also delete project\smb1 folder

Samba Sharing for Linux experiments (password Authentication)

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.