About Samba
What is Samba?
Samba is a free software that allows the Unix family of operating systems to link to the Smb/cifs (Server Message block/common Internet File System) network protocol of the Microsoft Windows operating system. The third edition not only accesses and shares SMB folders and printers, it can also integrate into the Windows Server domain, play as a domain controller, and join Active Directory members. In short, this software bridges a bridge between windows and the Unix family of OS, allowing both resources to be mutually-acceptable.
Features of Samba
Share file and printer features
Provides authentication capabilities to log on to samba servers in different identities to access different files
Host name resolution on a Windows network
Sharing of devices
the structure of samba
650) this.width=650; "Src=" http://img.blog.csdn.net/20170808130748529?watermark/2/text/ ahr0cdovl2jsb2cuy3nkbi5uzxqva2fpcnvpmtiz/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/ Southeast "alt=" here to write a picture describing "title=" "/>
The Samba server driven by smbd,winbid process NSS_LDAP process, and uses the NMBD process to provide a NetBIOS communication protocol for domain name resolution. SMBD is a service process for SMB.
The samba client is made up of CIFS server,active director and S and vices for UNIX.
The Smaba listens on the 137/udp,138/udp,139/tcp,445/tcp port.
about NetBIOS
NetBIOS is the abbreviation for the network basic input and output system (English: NET basic input/output systems), which provides a session-level service in the OSI model, allowing different programs to run on different computers, connect to each other on the LAN, and share data. Strictly speaking, NetBIOS is not a network protocol, but an application interface (API). Older operating systems, using the IEEE 802.2 and ipx/spx protocols, can operate using the NetBIOS frames protocol or the NetBIOS over ipx/spx protocol. Modern operating systems, most of which use the TCP/IP protocol, can communicate with each other through the NetBIOS over TCP/IP protocol.
the relationship between Samba and NetBIOS
Samba This filesystem architecture was developed on the NetBIOS communication Protocol, since the early NetBIOS is not cross-routed, only within the local area network transmission, and later developed a NetBIOS over TCP/IP technology, to test Samba application to Ethernet.
SAMBA Server Installation and configuration
Installation of SAMBA server
Download: [[email protected] ~]# wget installation dependent: [[email protected] ~]# Yum install python-devel gnutls-devel gnutls libacl-de Vel openldap-devel installation: [[email protected] ~]# TAR-XZF samba-4.6.6.tar.gz [[email protected] ~]# CD samba-4.6.6 [ [email protected] samba-4.6.6]# make && make install
Samba configuration file in a detailed
[global]# ------------- Network Related Options -----------------# workgroup = mygroup //Host group name, Hosts in the host group are the same server string = Samba Server Version %v netbios name = MYSERVER //netbios name, each host is not the same interfaces = lo eth0 192.168.12.2/24 192.168.13.2/24 hosts allow = 127. 192.168.12. 192.168.13. //host white list # ---------------- Logging Options ------------------ --- log file = /var/log/samba/log.%m Log in log path max log size = 50 //log file size # ---- --------- Standalone Server Options ----------------- security = user|shar|domain //set sharing permissions, Shar: Information does not require a password, you can share files. User: Use Samba's own password profile passdb backend = tdbsam //database format. Default is tdsam[share_name] comment = all printers //description path = /var/spool/samba //Sharing Path browseable = no //whether all users can see this project guest ok = no writable = no //whether to write operations printable = yes //whether to show Table write list=user1,user2 or +group //Writable User Form public=yes //does not belong to the user, whether it can be displayed out of the read only=yes //Read-only create mode = 0664 //establishing file Permissions directory mode = 0775 //permissions to create a directory
Built-in variables for configuration files
%m:client-Side NetBIOS hostname%m:client-side internet hostname, or hostname. NetBIOS hostname of the%l:samba host%h: User's home directory%u: User name of the user who is currently logged on%g: The user's group name for the login%h:samba host name%i:client ip%t: Date
Test
No user authentication Test
Server-side configuration:
Configuration file:
650) this.width=650; "Src=" http://img.blog.csdn.net/20170808153547339?watermark/2/text/ ahr0cdovl2jsb2cuy3nkbi5uzxqva2fpcnvpmtiz/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/ Southeast "alt=" here to write a picture describing "title=" "/>
Detection configuration file
650) this.width=650; "Src=" http://img.blog.csdn.net/20170808153500324?watermark/2/text/ ahr0cdovl2jsb2cuy3nkbi5uzxqva2fpcnvpmtiz/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/ Southeast "alt=" here to write a picture describing "title=" "/>
Start the service:
650) this.width=650; "Src=" http://img.blog.csdn.net/20170808153722952?watermark/2/text/ ahr0cdovl2jsb2cuy3nkbi5uzxqva2fpcnvpmtiz/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/ Southeast "alt=" here to write a picture describing "title=" "/>
Linux Client testing:
Check the shares on the server:
650) this.width=650; "Src=" http://img.blog.csdn.net/20170808155912258?watermark/2/text/ ahr0cdovl2jsb2cuy3nkbi5uzxqva2fpcnvpmtiz/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/ Southeast "alt=" here to write a picture describing "title=" "/>
650) this.width=650; "Src=" http://img.blog.csdn.net/20170808163135363?watermark/2/text/ ahr0cdovl2jsb2cuy3nkbi5uzxqva2fpcnvpmtiz/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/ Southeast "alt=" here to write a picture describing "title=" "/>
Windows Client tests:
Visit: http://jingyan.baidu.com/article/b87fe19e63458052183568e3.html
User authentication Test
Server-side configuration:
Samba Server configuration file
650) this.width=650; "Src=" http://img.blog.csdn.net/20170808164903809?watermark/2/text/ ahr0cdovl2jsb2cuy3nkbi5uzxqva2fpcnvpmtiz/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/ Southeast "alt=" here to write a picture describing "title=" "/>
Set up your account and password:
[[email protected]/]# useradd-g users smb1[[email protected]/]# useradd-g users smb2[[email protected]/]# passwd SMB1 Change the password for the user smb1. New Password: 1234 re-enter the new password: 1234passwd: All authentication tokens have been successfully updated. [[email protected]/]# passwd smb2 change user smb2 password. New Password: 1234 re-enter the new password: 1234passwd: All authentication tokens have been successfully updated. [Email protected]/]# smbpasswd-a smb1 new SMB password:7890retype new SMB password:7890added user smb1. [[email protected]/]# smbpasswd-a smb2new SMB password:7890retype new SMB password:7890added user smb2.12345678910111213 141516171819201234567891011121314151617181920
Note : The SMBPASSWD command sets the SMB password to the system user, the-a parameter adds the user
Linux side test:
650) this.width=650; "Src=" http://img.blog.csdn.net/20170808172132081?watermark/2/text/ ahr0cdovl2jsb2cuy3nkbi5uzxqva2fpcnvpmtiz/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/ Southeast "alt=" here to write a picture describing "title=" "/>
650) this.width=650; "Src=" http://img.blog.csdn.net/20170808172140486?watermark/2/text/ ahr0cdovl2jsb2cuy3nkbi5uzxqva2fpcnvpmtiz/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/ Southeast "alt=" here to write a picture describing "title=" "/>
650) this.width=650; "Src=" http://img.blog.csdn.net/20170808172151863?watermark/2/text/ ahr0cdovl2jsb2cuy3nkbi5uzxqva2fpcnvpmtiz/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/ Southeast "alt=" here to write a picture describing "title=" "/>
Windows-Side testing:
650) this.width=650; "Src=" http://img.blog.csdn.net/20170808171431161?watermark/2/text/ ahr0cdovl2jsb2cuy3nkbi5uzxqva2fpcnvpmtiz/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/ Southeast "alt=" here to write a picture describing "title=" "/>
650) this.width=650; "Src=" http://img.blog.csdn.net/20170808171440240?watermark/2/text/ ahr0cdovl2jsb2cuy3nkbi5uzxqva2fpcnvpmtiz/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/ Southeast "alt=" here to write a picture describing "title=" "/>
650) this.width=650; "Src=" http://img.blog.csdn.net/20170808171448923?watermark/2/text/ ahr0cdovl2jsb2cuy3nkbi5uzxqva2fpcnvpmtiz/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/ Southeast "alt=" here to write a picture describing "title=" "/>
650) this.width=650; "Src=" http://img.blog.csdn.net/20170808171459322?watermark/2/text/ ahr0cdovl2jsb2cuy3nkbi5uzxqva2fpcnvpmtiz/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/ Southeast "alt=" here to write a picture describing "title=" "/>
650) this.width=650; "Src=" http://img.blog.csdn.net/20170808171507980?watermark/2/text/ ahr0cdovl2jsb2cuy3nkbi5uzxqva2fpcnvpmtiz/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/ Southeast "alt=" here to write a picture describing "title=" "/>
Setup and explanation of Samba server for Linux