Common Threads: Samba introduction part 1

Source: Internet
Author: User
Article Title: General thread: Samba introduction part 1. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Key concepts
  
Daniel Robbins
President/CEO, Gentoo Technologies, Inc.
  
Content:
Demonstrate Samba
Samba printing
Samba sharing
Browsing networks
Samba security
Samba seen from the Unix side
Next Step
References
About the Author
  
Samba is a great tool for anyone who uses both Unix and Windows. By implementing the SMB/CIFS protocol for Unix, Samba allows Unix systems to share resources with standard Windows clients. In this introductory article-the first article in the series of new columns provided by Daniel Robbins for developerWorks, he will introduce what Samba can do. This article focuses on key concepts. (In the next article, he will guide you through the installation process .) After reading this article, you will understand what Samba can do and how it works.
  
Welcome to the "general thread" section, a new column in the Linux area on developerWorks. Every two weeks, I will bring you some articles that will go deep into the technologies that affect the Linux and open source world. This column starts with three series related to Samba, which is a leading technology used to integrate Windows and Unix. I will show you how Samba works and how to configure and run it on your system.
  
In future articles, I will discuss some hot topics, such as multithreading, and provide some insider introductions on emerging technologies that are designed to shake the computing world. Always come back and have a look-don't miss any article!
  
Demonstrate Samba
First, I want to display a set of screen snapshots from one of my Windows NT machines named kompressor. These screen snapshots demonstrate a fully configured Samba system from the Windows side. They will bring you a practical idea of Samba functionality.
  
Currently, three machines are set in my internal LAN.
  
Ntbox (Windows NT Workstation)
Freebox (FreeBSD server)
Kompressor (Windows NT Workstation, used as my main desktop)
  
In this environment, Samba is widely used to share files, print files, and even run Windows applications directly from freebox (Unix. A screen snapshot shows the content of kompressor "network neighbor:
  
"Network neighbor" of kompressor"
  
You can see that both ntbox and kompressor are visible, which is not surprising because they are both NT Workstation. But I can also see freebox. Because freebox runs Samba, I can see it under "network neighbor" on each Windows machine that is part of the \ "GENTOO \" Windows working group.
  
Now let's take a look at what the freebox "internal" looks like. Double-click the freebox icon and the following window is displayed:
  
SMB/CIFS sharing on freebox
  
Definition of combination words at the beginning
SMB represents the Server Message Block, which is the original name of the protocol used to share files on Windows. CIFS stands for the Common Internet File System (CIFS), which is the combination of the beginning and end words Microsoft describes the latest version of the protocol.
  
In this window, you can see a group of things that we call "sharing. More specifically, they are called SMB/CIFS sharing, which contains parts of the freebox file system that can be accessed over the network.
  
On freebox, Samba is specially configured to create only the special shares you see above. Drobbins share the content of the main directory. I like to store all files in freebox (under Unix) for centralized and easy management. One advantage of Samba is that it allows administrators to centralize the storage of user files, rather than providing two separate file locations for each user for Windows and Unix.
  
Samba printing
In addition to standard sharing (as a virtual directory), you can also see Printer Sharing named nec. Another important feature of Samba is that you can share a printer in the same way as any Windows machine. Nec is my NEC SuperScript 870 laser printer that connects to freebox and is set to a standard Unix lpd-based printer. Samba allows the printer to be used by a Windows client, just like a standard Windows network printer.
  
Because the printer runs on Unix, you may wonder how the printer driver status is handled. Yes. On freebox, nec is set to a port-based standard parallel printer running in raw mode. In other words, any print job sent to nec is directly transmitted to the printer as is without any filtering or data processing.
  
On kompressor, nec is configured as the NEC SuperScript 870 network printer. When I print it, the local NT printer driver generates binary data for nec, and then automatically goes offline to the Samba running on freebox on the network. Samba automatically inserts the data into the nec queue without any change, and the printer starts to print the job.
  
It should be noted that my NEC SuperScript 870 is not a Postscript printer; it uses Adobe's patented PrintGear technology. Although the printer is not fully supported on Unix, it can still process printing from Windows (this is because all printer-specific data is generated by using the Windows Driver on Windows ). The irony is that GhostScript (a free-of-charge PostScript-compatible interpreter that can be used for Unix) does not know how to generate PrintGear output, I can only print ASCII plain text or 300 dpi PCL4-based documents from the Unix side, but from the Windows side, the Windows NT driver allows me to print a full 600 dpi. Now I don't think this will be inconvenient, because most of my prints are from Windows. But it is better to have a built-in Postscript printer in the future, so that I can use all the printer functions from Unix.
  
Samba sharing
Okay. now we should take a look at the next screen snapshot. This screen snapshot shows the content shared by drobbins on freebox. it is configured to share my Unix main directory. All files listed in the window are actually in freebox, but they can be accessed directly from my Windows NT client. It's great to integrate Windows with Unix!
  
My home directory on freebox accessed from kompressor
  
Understanding Samba
To learn more about how Samba works internally, I would like to give you a very simplified description, tell you what happened in the backend when I was playing around in my "network neighbor. First, I should explain the current Windows session. Because I am running Windows NT Workstation, I have to log on to obtain access to the machine. For this NT session, the user name used when I log on to the local machine is \ "Administrator \", and the password is \ "mypass \". If I am running Windows 95 or 98, the standard Windows network driver requires me to enter the user name and password. In Windows 95 and 98, this password is not used to determine who can access the local machine, but is cached and used to connect to network resources.
  
Of course, Windows NT is safe compared with Windows 95 and 98. if you do not provide a valid user name and password, you are not allowed to use the machine. After kompressor confirms the user name and password against its local security database, it allows me to start using Windows. When I connect to a password-protected network resource, Kompressor will also use my username and password to try to authenticate myself automatically.
  
Browsing networks
When I click "network neighbor", a window will pop up, containing a list of all Windows compatible machines on the network. To enable this operation, kompressor contacts the freebox behind the scenes to obtain the "Browsing list" of all Windows compatible machines on the current subnet ". Kompressor contacted freebox because I configured Samba of freebox, in this way, it can become a "main local browser" on the network (which means freebox manages the list of network resources that appear in "Network neighbors ).
  
The next thing I do is double-click freebox. a new window is displayed and all the shares on freebox are displayed. To enable kompressor to receive this information, it serves as a special hidden sharing (IPC $) connection between the guest user and freebox, and downloads all available shared names and types. In the next article, when we configure Samba, we need to put an option into the Samba configuration file to specify which Unix account is equivalent to the \ "guest \" user of NT. If it is not set correctly, you cannot browse any resources on the Samba machine. Because it shows that you can view SMB/CIFS shares on the Samba server without any special permission, this is also worth mentioning for security purposes.
  
Now I can click drobbins share to display the content of the main directory. When it occurs automatically, it is necessary to understand the hidden dialog between freebox and kompressor. this session eventually grants me access to drobbins. But before we get there, we will discuss some Samba security issues first.
  
Samba security
When Samba is configured, I set drobbins sharing to password-protected; even on my own dedicated LAN, I still want to lock something to some extent. At the same time, I set two Samba users: drobbins and administrator. Set their passwords to match the passwords on my NT Workstations to be consistent. For drobbins sharing, my security policy is as follows: if you are a valid Samba user and provide the correct password for the user, you can access drobbins sharing. Therefore, both administrator and drobbins are granted access, as long as the user provides the correct password for their accounts.
  
Now let's go back to the dialog between freebox and kompressor. Because I logged on as administrator, therefore, double-click drobbins sharing will cause Windows NT to automatically try to authenticate me to Samba by sending the username \ "administrator \" and password \ "mypass \" to freebox. Samba then checks these values against its internal security database (which is separated from the standard Unix passwd database) to verify the user name and password. Samba grants me access after the user name/password combination is checked out.
  
You may wonder why Samba has its own unique password database. Why does it not use a standard Unix password to authenticate administrator users? When Windows sends a password in plain text, it may have done so in the past, but all modern Windows send an SMB/CIFS password in encrypted form, which is hashed out from the standard Unix password.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.