Implementation principle and usage of SAMBA

Source: Internet
Author: User
I. The origins of SAMBA for windows Network neighbors, the file sharing method uses the NFS protocol between SMB and CIFS protocols and the NETBIOS protocol LinuxUnix. However, Linux and Windows cannot be shared. Therefore, AndrewTridgell of the Australian National University decided to develop a software to achieve different

I. Origins of SAMBA

For windows Network neighbors, the file sharing method uses NFS protocol between SMB, CIFS protocol and NETBIOS protocol Linux/Unix.

However, Linux and Windows cannot be shared, so Andrew Tr of the Australian National UniversityIdGell decided to develop a software. The software was designed to share files between different systems, so a software named SMB was born, however, this name cannot be registered as A trademark because the SMB protocol already exists. Therefore, the author adds two "A" to the name and becomes the file sharing server with strong functions to be used:

SAMBA

Ii. How SAMBA works

SAMBA mainly provides SMB/CIFS or NETBIOS protocols.

So long as SAMBA is used, it can make Linux appear in the network neighbor of Windows, or share Windows files on Linux --

Once installed on linux, there are two main processes:

1. nmbd: provides NETBIOS name resolution

2. smdb: Provides File Sharing.

Because NETBIOS listens to TCP port 139 and UDP port 137,138 for windows, nmbd has modeled udp ports 137 and 138 on linux and tCpSmdb is used to simulate tcp port 139. SAMBA listens to these four ports at the same time on Linux. 

3. Understanding SAMBA

SAMBA software starts with samba.

Samba-client

Both samba-common are used as clients.

Samba is used as the server

A graphic-based control interface of samba-swat

After the installation is complete, its configuration file is in/etc/samba/smb. conf

The/etc/init. d/smb script implements SAMBA control.

For example:/etc/init. d/smb start

Note: samba is a software that accepts selinux control. Therefore, selinux must be disabled during configuration.

4. install and configure SAMBA

1. installation:

Yum install samba-y

After the installation is complete, go to the/etc/samba directory.

The main configuration file is smb. conf.

TIPS:

All the files starting with # in this type of file are annotated and meaningless.

All items starting with ";" can remove the start option.

2. Configuration:

The configuration file consists of four main segments:

1. global configuration segment [global]

2. Home Directory section [homes]

3. Independent shared segments [printer]

4. Custom segment [c_s]

Let's analyze it for a while.

Section 1: [global]:

Workgroup = MYGROUPDefine the workgroup's

Server sTrIng = Samba Server Version % vThis is used to comment out the information when you open it through a network neighbor.

Netbios name = XXXName displayed on the terminal

Security = userThis is critical to defining the security level of the SAMBA service. There are four security levels.

1. share: allow direct access by any anonymous user

2. user: by default, each user must provide an account and password for access.

3. domain/server: it usually means that the user's account and password are collectively authenticated by a third party during authentication. Instead of directly passing the system authentication, for example, there is a dedicated Authentication Server

4. ads: authenticated by the Primary Domain Controller

Passdb backend = tdbsamHow to authenticate all SAMBA User Authentication Files

Load printers = yesTry to load printer?

Cups options = rawGeneral printing system, specifying the printing Mode

Hosts allow = XX. XXDefine the access control list

Section 2: [homes]:

Comment = Home DirectoriesDescription

Browseable = noIf the user is not the owner of the Directory, can the user view the directory? no indicates that only the owner can view the Directory

Writable = yesWhether the file can be created in.

 

Section 3: [printers]:

Comment = All Printers

Path =/var/spool/sambaPrint pool

Browseable = no

Guest OK = noWhether the printer is public

Writable = no

Printable = yes

Section 4: define our own: [tooLs]

The name enclosed in brackets is the shared name.

Comment = My Tools

Path =/shareUsed to define the real location of the directory on the system directory

Browseable = yesBrowsed or not

Guest OK = yesAllow guest account?

Writable = yesWritable or not

#WriteList = XXXDefine a list to determine whether users/groups can be written. when defining a group, use the @ group name.

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.