First, the experimental requirements
There are three accounts smb1, SMB2, SMB3, all belonging to the Users group
The Linux password for all three accounts is 1234,samba password 4321
Samba Services share/home/project directory, resource share named Project
Three accounts can use project resources, and members of the Users group have write access to project
Each of the three accounts has its own home directory under Samba services
Samba security is User level
Second, the server configuration
Installation: Yum Install-y Samba
Shut down firewall: Service iptables stop
Set up three accounts: Useradd-g users SMB1
Useradd-g Users SMB2
Useradd-g Users SMB3
Set up your account Linux password: Echo 1234 | passwd--stdin SMB1
echo 1234 | passwd--stdin SMB2
echo 1234 | passwd--stdin SMB3
Create project folder: Mkdir/home/project
Chgrp Users/home/project
chmod 2770/home/project
Ll-d/home/project
Backup configuration file: Cp/etc/samba/smb.conf/etc/samba/smb.conf.bak
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)