Article Title: How to build the SAMBA service in Linux. 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.
This document only describes the simplest setup process of SAMBA. It aims to help you quickly build and get started;
I. Concepts and Principles
(1) Concepts
SAMBA: Send Message Block
A protocol for sharing files and printers on the LAN enables sharing between Unix and Windows systems, enabling Windows to access Unix hosts using "Network neighbors;
(2) Working Principle
Let the NETBIOS and SMA protocols run on TCP/IP communication protocols, and use the NETBEUI protocol of Windows so that LINUX can be seen by Windows on network neighbors;
SAMBA is based on two Deamon:
(3) related daemon
1. SAMBA: Set the shared directory and printer;
2. numbed: Manages group and NetBIOS Name resolution;
II. Specific Construction
Of course, you need to check whether the SAMBA package has been installed in the system. If you do not want to perform the installation, you can simply download the CD or the source code for compilation and installation. This build is based on the SAMBA self-contained in FC5;
Main configuration file:
/Etc/samba/smb. conf
#============================== Global Settings ========================
[Global] is mainly used for the following items, and the rest can be kept unchanged. Of course, if you want to use more complex and advanced functional services, it should be another question;
# Workgroup = NT-Domain-Name or Workgroup-Name
Workgroup = MSHOME # Name of the working group to which the host belongs
# Server string is the equivalent of the NT Description field
Server string = Samba Server # SAMBA server host comments, optional, but we recommend that you keep them as detailed and accurate as possible to help you identify them;
# Security mode. Most people will want user level security. See security_level.txt for details.
Security = share # security mode. Because it is a shared directory, share is used;
#================================ Share Definitions ==============
You can add the directory you want to share directly at the end of the shared part, and pay attention to its access permissions;
[Nfs]
Path =/var/nfs
Public = yes
Writable = yes
The/var/nfs directory can be read and writable to all users;
4. Start the service
With the preceding simple settings, after restarting the service, you can access the service in the network neighbors in Windows;
In FC5, the service name is smb and nmb. When smb is started, nmb is automatically started;
5. Notes
1. Firewall Problems
2. Ensure the access permission of the shared directory
3. Make sure that the directory exists on the server before accessing the shared directory through the network neighbor.