Install and configure Samba on cent OS 6.x

Source: Internet
Author: User
I. Basic Introduction

Server messages Block (SMB) is a communication protocol used to share files and printers on a LAN, it provides sharing services for files, printers, and other resources between different computers in the LAN. The SMB protocol is a client/server protocol that allows a client to access shared file systems, printers, and other resources on the server. By setting "NetBIOS over TCP/IP", Samba can not only share resources with local network hosts, but also share resources with computers around the world.

 

Ii. Origins of SMB

In the early online world, most of the file data transmitted between different hosts was via FTP, a handy server software. However, there is a small problem when using FTP to transfer files, so you cannot directly modify the file data on the host! That is to say, if you want to change a file on a Linux host, the file must be downloaded to the client by the server before modification. Therefore, the file exists on both the server and client. At this time, if one day you modified a file but forgot to upload the data back to the host, how can you know that the file is the latest after a while ?!

Since there is such a problem, you can directly access the files on the server on the client side. If you can directly access the files on the server side on the client side, in this case, the archive data does not need to exist on the client, that is, as long as the archive data on the server exists! Is there a file system like this )? Fortunately, networkfile system and NFS are one of these file systems! As long as I mount the shared directory provided by the server on the client side, I can directly access the file data on the server on the client machine, this data is like a partition on the client side! In addition to NFS servers that allow UNIX like machines to share files with each other, Microsoft also has a file system similar to that of commoninternet file system and CIFS! The simplest idea of CIFS is the common "Network neighbors 』. Windows computers can share the file data provided by others through "Network neighbors" on the desktop. However, NFS can only communicate with Unix machines, and CIFS can only communicate with Windows machines. Is there an archive system that allows Windows and Unix-like platforms to share their archive data?

In 1991, a college student named Andrew tridgwell had such troubles. He had three computers running dos PC, Dec Digital UNIX, and Sun UNIX. At that time, Dec developed a software called pathworks, which can be used to share the archive data of the UNIX operating systems of DEC and the DOS Operating Systems of personal computers, unfortunately, tridgwell is troubled by the fact that Sun's Unix cannot use this software to share data. At this time, tridgwell would like to say, "Okay! Since the two systems can communicate with each other, Sun has to be so miserable? Can I find out the operating principles of these two systems and then allow sun to share archive data ?』, To solve this problem, the old man wrote a program to detect the communication protocol information used by DOS and Dec UNIX systems during data sharing and transmission, then extract the important information and develop the file system servermessage Block (SMB) based on the communication protocol found above, this SMB software allows UNIX and DOS to share data with each other! (Note: Once again, the file system that can share file data on UNIX like is NFS, the file system used by the "Network Neighbor" on Windows is called the Common Internet File System, CIFS)

Therefore, tridgwell applied for the smbserver (short for Server Message Block) name as the trademark of the software he wrote. Unfortunately, because SMB is meaningless, therefore, there is no way to achieve registration. In this case, can you find related words in the dictionary and register them as trademarks? It's been around for a long time! This Samba contains SMB and is also the name of a passionate Latin dance. It is better to use this name as a trademark. This becomes the name of samba we are using today.

Iii. Software Installation Configuration

1. Package Kit

Samba ----- all files of the Samba server program

Samba-common ----- provides public parts that must be used by both the Samba server and client.

Samba-client ----- provides all files of the samba client

Samba-SWAT ----- provides a Web interface for managing Samba servers

2. Create a samba user

# Smbpasswd-A user1 ("-a" is used to create a samba user, and "-X" is used to delete the user)

3. modify the configuration file

Location of the samba configuration file:/etc/samba/smb. conf

Vim/etc/samba/smb. conf

Samba servers have five security levels: User, share, server, domain, and ads. When different levels are set, the Samba server also uses the password server and the encrypted password. "User" is set by default"

1. User ----- the user name and password must be entered when the client accesses the server. After verification, the shared resources of the server can be used. This level uses encrypted transmission passwords. 2. Share ----- the client does not need to enter the user name and password when connecting to the server. 3. Server ----- the client also needs to enter the user name and password when accessing the server. However, the password verification server is responsible for password verification. 4. Domain ----- use the domain controller to authenticate the user. 5. Ads ----- if the Samba server is added to the Windows Active Directory, the ads security level is used. The ads security level must also specify the password server.

650) This. width = 650; "Title =" 0.png" alt = "wKioL1RA3rKAcRP-AAFEXfBWDic930.jpg" src = "http://s3.51cto.com/wyfs02/M00/4C/9B/wKioL1RA3rKAcRP-AAFEXfBWDic930.jpg"/>

4. shared directory Configuration

650) This. width = 650; "Title =" 0.png" src = "http://s3.51cto.com/wyfs02/M00/4C/9B/wKioL1RA34fyLMNNAADMmjPtn7g319.jpg" alt = "wkiol1ra34fylmnnaadmmjptn7g319.jpg"/>

[Homes] ----- Samba user's home directory

Comment = home directories ----- set shared description

Browseable = No ----- directory browsing permission

Writable = Yes ----- users can write to the shared directory

This shared directory can only be used by users. By default, the user's home directory is located in the/home directory, and each linux user has a subdirectory named after the user name.

The following are settings for the shared printer:

[Printers] ----- share a printer

Comment = all printers ----- set shared description

Path =/var/spool/samba ----- specify the path of the shared directory

Browseable = No ----- directory browsing permission

Guest OK = No ----- allow guest access

Writable = No ----- users can write to the shared directory

Printable = Yes ----- print

The above are the default settings of the system.

Add a custom shared directory: (user1 has ownership of/Asus, user2 has read-only permission, and other users are not allowed to access; public shared directory allows all users to access and upload files)

[Asus]

Comment = user1 directories ----- set shared description

Browseable = Yes ----- all Samba users can see this directory

Writable = Yes ----- users can write to the shared directory

Path =/Asus ----- specify the path of the shared directory

[Public]

Comment = All User Directories ----- set shared description

Browseable = Yes ----- all Samba users can see this directory

Writable = Yes ----- users can write to the shared directory

Path =/Public ----- specify the path of the shared directory

Guest OK = Yes ----- allow guest access

Write list = + mygroup or @ mygroup ------ it can be a group or multiple users can be separated by commas

5. Samba test command

Samba monitors UDP port 136 137 139 of TCP

Testparm: test the Configuration File Syntax Error and display the final configuration that takes effect

6. Configure Samba in Gui Mode

Install samba-SWAT: Yum install samba-SWAT xinetd

Service xinted start

# Vim/etc/xinetd. d/Swat

Disable = No

Only_from = IP address to be opened

Service xinted restart

Test Access: IP: 901

650) This. width = 650; "Title =" 0.png" alt = "wkiom1ra3wfhvxdbaaozizr9cli955.jpg" src = "http://s3.51cto.com/wyfs02/M01/4C/9A/wKiom1RA3WfhVxDbAAOZizr9CLI955.jpg"/>

 

This article is from the "icesnowfq blog", please be sure to keep this source http://icesnowfq.blog.51cto.com/2785832/1565224

Install and configure Samba on cent OS 6.x

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.