A, Samba Services Overview
In Windows network environments, make print and share files between machines is achieved by Microsoft's own SMB / CIFS protocol, SMB (Server Message Block) and CIFS (Common Internet File System) Both are Microsoft proprietary protocols
And in Linux Samba implements Microsoft's SMB / CIFS networking protocol, which enables cross-platform file sharing easier, SMB is also based on C / S architecture, so both can act as a file sharing server, it can also act as a client end
1) Samba software packages
Samba can be found on several packages in CentOS7, it has a default client samba-client and server install samba
[root @ node1 ~] # RPM -qa | grep Samba Samba-Client-libs-4.7.1-6.el7.x86_64 # client software samba-common-libs-4.7.1-6.el7.x86_64 # required library public assemblies samba-common-4.7.1-6.el7.noarch # provide services and client program
2) Samba program components
Samba services provided smbd, nmbd two service programs that perform different functions, respectively
smbd: responsible for providing access to the server in a shared resource for the client nmbd: responsible for providing host-based NetBIOS name resolution protocol
After installing the samba software, the system will automatically add the standard system, called smb service and nmb using netstat view the listening port
smbd is responsible for monitoring port 139 TCP protocol (SMB protocol), 445 port (CIFS protocol), nmbd is responsible for listening on UDP ports 137-138 (NetBIOS)
Two, Samba deployment and configuration file description
1) Samba deployment
Tip: When you install Samba we can use yum way to install, but can also go to the official website to download to install the latest source package
[root@node1 ~]# yum -y install samba* [root@node1 ~]# systemctl enable smb [root@node1 ~]# systemctl enable nmb [root@node1 ~]# systemctl start smb [root@node1 ~]# systemctl start nmb tcp 0 0 0.0.0.0:445 0.0.0.0:* 1861/smbd tcp 0 0 0.0.0.0:139 0.0.0.0:* 1861/smbd udp 0 0 0.0.0.0:137 0.0.0.0:* 1873/nmbd udp 0 0 0.0.0.0:138 0.0.0.0:* 1873/nmbd
2) Samba configuration file description
The main Samba configuration file is located at: /etc/samba/smb.conf
Which is comment number # beginning to; number of beginning sample configuration, the Samba configuration file is divided into three parts, as follows:
[global] global settings: # This configuration items are valid for the whole Samba server [homes] host sharing settings: The default shared # Set the user corresponding to the user's home directory [printers] printer sharing: # If we need to share the printer device, can be here set items
Common Item Description 3) Samba's
workgroup: # set up a workgroup name server string: # set up the server provides information comment: # Description Information Set shared directory path: # Set the shared directory location browseable: # Set Network Neighborhood whether courseware guest ok: # whether everyone can access the shared directory the public role of the same writable: # if everyone can write, read only configuration items and the role opposite max log size = 60: maximum capacity #define log is 60KB passwd backend: # file sharing account type, default tdbsam log file = path / log% m:. location # set the log file% .m represented client the IP security: # provided Samba secure authentication can be set to: User, Share, server, Domain Share: anonymous access user: by the local server verify the user name and password domain: the domain controller to validate the user name and password server: specify another server to validate the user name and password
[] Just to pass the time