- Training mission statement -
实训 配置与管理Samba服务器
First, the purpose of training
- Master resource sharing and exchange of visits between Linux and Windows method.
- Master the installation and configuration of Samba server.
Second, the project needs
Background: A company's technical department needs to add a Samba server as a file server, workgroup named Workgroup, published shared directory / share / tech, share name tech, this shared directory allows all employees to access technical department, allows browsing, to allow reading write, do not allow anonymous service.
三、实训环境
1. Systems and Software Environment
Operating System: CentOS 7 / RHEL7 (server), windows 7/10 / Server ( as client authentication)
2. Experimental configuration files and command
configuration file: *** profile
command: ifconfig, setup, vi etc.
Third, the training content
CentOS 7 / RHEL 7 as a server, can access the network, and can provide file sharing services Samba server;
Windows Server / Win7 as a client, can access the shared directory on CentOS 7 / RHEL 7 server;
Fourth, the training step
1. Install the samba server
① # rpm -qa | grep samba // query whether the samba installation
// As shown above, the relevant packages are installed
// If there is no relevant packages, can mount CD-ROM, and then modify yum local source, can be installed. See in particular items 3 and 9
2. Re-install Samba
① mount the ISO installation image
#mkdir / iso // establish a mount point directory
mount / dev / cdrom / iso // mount the CD to the next / iso directory
② backup yum original source
#cd / etc // switch to the / etc directory
#mkdir yum.repos.d.bak // create a backup folder to store yum source to back up
#mv yum.repos.d / *. yum repo yum.repos.d.bak // backup source
#ls yum.repos.d // view the backup effect
#ls yum.repos.d.bak // View backup effects
③ prepared for installation yum source documents dvd.repo
Vim source configuration file // dvd.repo
④ use yum to see the samba package information
#yum info samba
⑤ using the command yum install samba service
#yum clean all // First clear the yum cache
#yum install samba -y // install samba service
#rpm -qa | grep samba // see if installed
⑥ open the samba service
#systemctl start smb / / open service
#systemctl status smb // check the status of
3. Configure samba server
① the establishment of a shared folder / report this content share / Tech
#mkdir / report this content share / Tech -p // create the shared folder / report this content share
#touch /share/tech/test_tech.tar // create a test file
② add users and groups tech technology department, and create a test user test_user1
# groupadd tech // establish technical groups, tech
# useradd-tech tech1 -g // build user tech1, and joined the technical team tech
# useradd-tech tech2 -g / / user tech2 established, and the technology to join the group Tech
# Useradd test_user1 // create a test user test_user1
#passwd tech1 // set a password for the user tech1
#passwd tech2 // set a password for the user tech2
#passwd test_user1 // set a password for the user test_user1
③ add the corresponding Samba account for the technical members of the Department
#smbpasswd -a tech1
#smbpasswd -a tech2
④ backup samba master configuration file
#cp /etc/samba/smb.conf /etc/samba/smb.conf.bak // the samba master configuration file backup
⑤ configure samba master configuration file
#vim / etc / samba / smb .conf // edit the main configuration file
// configuration information as follows:
// if there is no write access, in the following line can read.only [Tech] added: Writable = Yes
⑥ local system set shared directory permissions
#chmod -R & lt 777 / Share / Tech
# -R tech1 chown: Tech / report this content share / Tech
#chown -R tech2: Tech / report this content share / Tech
⑦ change the value of a shared context directory, or ban SELinux
#chcon -t samba_share_t / report this content share / Tech -R
or:
#getenforce
#setenforce Permissive
⑧ open the firewall
# firewall-cmd --permanent --add-service = samba // the Samba added to the firewall to allow service
# firewall-cmd --reload // reload firewall
# firewall-cmd --list-all // Check the list of firewall, confirm Samba added to the firewall to allow the service
to configure Samba ⑨ update service
systemctl reload smb // reload Samba service
or
systemctl restart smb // restart the smb service
4. Test client access Samba shares (using win7 VMs)
① Type windows + R, enter: \ 192.168.97.110
with tech1 log on, create a test folder, whether the test can be written
The win ② cancellation system virtual machine
type windows + R, enter: \ 192.168.97.110
with test_user1 login, login failures found
(make it complete)
V. Submissions
1. The network parameter configuration and connectivity test shots 6 points
①samba server, the network configuration information centos7.4
network client configuration information ②2k3
③ test client connectivity and server-side:
2. Install the server and start a successful interface 6 points
3. user or file settings Screenshot 6 points
4. Main Configuration document theme 6 minutes
5. Run the experimental result of step 6 theme points
① with tech1 login, whether the test write
② with test_user1 login, login failures found
Six, scoring criteria
1. Submit time 60 minutes
2 30 content integrity
3. 10. Format Specification
Seven Questions
How to set up a specific network can not access the shared folders? ? ?
In [Tech] below the main configuration file, write the following two lines, to
hosts deny = 192.168.10. # 192.168.10 rejected. Samba network access server
hosts allow = 192.168.20. # 192.168.20 rejected. Samba network access server