[Linux operation and maintenance training] What is Samba? What are its functions?

  Friends who know the "Linux" system must have heard of samba. So what does the samba service mean in the Linux system? Samba is a software that allows the Linux system to apply the Microsoft network communication protocol. It can be used for direct file sharing and printing sharing between Linux and Windows systems. The following is a detailed introduction.

  What is Samba?

  SAMBA is a free software that implements the SMB protocol on Linux and UNIX systems, and consists of server and client programs. SMB is a communication protocol for sharing files and printers on a local area network. It provides sharing services for resources such as files and printers among different computers in the local area network. The SMB protocol is a client/server protocol through which the client can access the shared file system, printers and other resources on the server. By setting NetBIOS over TCP/IP, Samba can not only share resources with LAN hosts, but also share resources with computers all over the world.

  Functions of Samba

  The biggest function of Samba is that it can be used for direct file sharing and printing sharing between Linux and Windows systems. Samba can be used for file sharing between Windows and Linux, and can also be used for resource sharing between Linux and Linux. Since NFS can It completes the data sharing between Linux and Linux very well, so Samba is mostly used in the data sharing between Linux and Windows.

  Samba working agreement

  The Samba service is powerful, which is related to its communication based on the SMB protocol. SMB not only provides directory and printer sharing, but also supports authentication and permission setting. Samba uses the NetBIOS protocol under Windows. If you want to use shared files under Linux, please confirm whether your Windows system complies with the NetBIOS protocol.

  How Samba works

  Protocol negotiation When the client accesses the Samba server, it sends a negprot instruction packet to inform the target computer of the SMB type it supports. The Samba server selects the optimal SMB type according to the client's situation and responds.

  Establish a connection When the SMB type is confirmed, the client will send a session setup command packet, submit the account number and password, and request to establish a connection with the Samba server. If the client passes the authentication, the Samba server will respond to the session setup message and provide Users are assigned a unique UID, which is used when clients communicate with them.

  Access to shared resources When a client accesses a Samba shared resource, it sends a tree connect command packet to notify the server of the shared resource name to be accessed. If the settings allow, the Samba server will assign a TID for each client to connect to the shared resource, and the client can Access the shared resources you need. After disconnecting the sharing, the client sends a tree disconnect message to the server to close the sharing and disconnect from the server.

Guess you like

Origin blog.csdn.net/oldboyedu1/article/details/132357773