Introduction to Samba

zhaozj2021-02-16  56

Samba is a set of software that allows UNIX systems to apply Microsoft Network Communication Protocol. It enables the machine to execute the Unix system to share drives and printers with a computer that performs a Windows system. Samba belongs to the software of GNU Public License (So); therefore, you can use it for free. What is SMB? The SMB (Server Message Block) Communication protocol is Microsoft and Intel (Intel) Agreement developed in 1987, mainly as a communication protocol for Microsoft networks, while Samba moves the SMB protocol to UNIX; Samba core Is the SMB (Server Message Block) protocol. The SMB protocol is a client / server type protocol, and the client can access shared file systems, printers, and other resources on the server through this protocol. Through the "NetBIOS Over TCP / IP", Samba can not only share resources with the local area network host, but also share resources with computers around the world; because the communication protocols used by 10 million hosts are TCP / IP. SMB is a protocol in the session layer and a Sentation Layer and a small partial application layer (ApplicationLayer). SMB uses NetBIOS Application Interface (Application Program Interface, referred to as API). In addition, it is an open protocol that allows protocol expansions - making it greater and complex; about 65 top jobs, and each job has more than 120 functions, even Windows NT is not all Supported, recently Microsoft renamed the SMB as a CIFS (Common Internet File System), and has joined many new features, and Samba also supports SMB extension protocols such as NT LAN Manager 0.12, which is Samba to manage NT domains. Ability. The main functions of Samba are as follows: (1) Provide Windows NT-style files and printers sharing Windows 95, Windows 98, Windows NT, etc. According to this shared UNIX, there is no difference between the appearance and the shared NT resources. (2) Analyze NetBIOS Name IP In the Windows network, in order to be able to use online resources while their resources can be used by others; each host is regularly broadcasting their identity information on the Internet. Responsible for collecting this information, for other hosts; servers who provide information to retrieve intelligence are called browse servers. Samba can effectively complete this feature Samba when Samba can be used as a WINS server when crossing the gateway. (3) Providing SMB Customer Function The SMBCLINT program provided by Samba can access Windows resources from UNIX to ftp. (4) Backup resource on the PC utilizes a shell script called SMBTAR, you can use the TAR format to back up and restore a shared file on Windows. (5) Provide a command line tool that can limit some of the management functions of NT on it.

Skating Samba to achieve Win2000 and Linux file sharing

With the popularity of Linux, how to share files under Linux becomes the problem of users' concerns. In fact, almost all Linux distribution kits provide a good tool Samba - through it to easily implement file sharing. Samba is an application based on the SMB protocol, and the current version is 2.3.x. Samba's function is very powerful, but ease of use is also extremely poor. The reason is that its configuration file is too large and it is not easy to understand, novice and confident hands look. However, if only file sharing is implemented, configure Samba is also very simple, just familiar with several operations. Here I use an example to indicate these operations. Suppose you are familiar with the basic operation of Linux and is familiar with the use of the VI editor.

Now we have three PCs, one installed WIN 2000, the name is TEST2000, there is a shared folder share; the rest is installed with Linux, one name is Testsamba, there is a directory / Pub; another name is Testlinux, there is also a directory / PUB. The goal we want to achieve is to share / pub on TestSamba for TEST2000 and TEST_LINUX.

We do the following: Test_SAMBA:

Locate SMB.conf under / etc /, open with a VI editor;

# vi /etc/smb.conf or vi /etc/samba/smb.conf

Under the [GoBal] field, add NetBIOS records, generally plus the next line of Workgroup record;

Netbios Name = Testsamba

Under the [GoBal] field, modify the SECRITY record;

SECRITY = Share

Under the [Public] field, modify the PATH record;

Path = / PUB

Add a Geuest OK record under the [Public] field;

Guest OK = YES

Delete the "public] field"; "indication;

Save exit.

Simply explained, the added "NetBIOS Name" is a machine name that can be seen in the TEST2000 network neighbor; the added / PUB is a shared directory that can be seen in the network neighbor; adding guest OK is allowing all users to guest accounts Access sharing; delete ";" indicated that the entire [public] field becomes executable.

Now / Pub has become a directory that can be shared by TEST2000 and Testlinux. Simple!

Try it:

Under TestSamba, you can do the following for shared folders under Test2000:

# SMBCLIENT -L // TEST2000

This command can view the sharing of TEST2000. Note that when the system is required to enter Password, you can enter the TEST2000 directly, and the sharing of TEST2000 is listed on the screen.

#smbclient \\ \\ Test2000 \\Share -u Share

This command can enter the Share directory of TEST2000. When the MS-DOS prompt (: \) appears on the screen, the user has entered the Share directory. At this point, you can enter the "?" Command after the prompt lookup you can use.

Under Test2000, use TestSamba shared directory / PUB, you can do the following:

Find Computer Testsamba, when the TestSamba target appears, double-click the icon PUB, ready to enter the shared folder Pub.

Under Testlinux, use the Testsamba shared directory PU, you can do the following: # SMBMount // Testsamba / Pub Pub

This command can hang the PUB under TestSamba on the PUB of this machine, and enter the transfer of Password directly on the system, then enter the #CD / PUB / PUB, # ls, and the screen is listed. Document.

转载请注明原文地址:https://www.9cbs.com/read-22738.html

New Post(0)