How to build a complete samba server in Linux (centos version)

How to build a complete samba server in Linux (centos version)

Preface

smb is the name of a protocol that can be used for Web connections and information communication between clients and servers. SMB was originally developed by Barry Feigenbaum of IBM with the goal of transforming the local file interface "interrupt 13" in the DOS operating system into a network file system.

SMB Service Introduction

Later, Microsoft made major changes to this development, and this changed version is also the most common version. Microsoft combined the SMB protocol with the network management program it had developed with 3Com and continued to add new features in Windows for Workgroups and later versions of Windows.

SMB was originally designed to run on the NetBIOS protocol (and NetBIOS itself runs on NetBEUI, IPX/SPX or TCP/IP protocols). Windows 2000 introduced the function of SMB running directly on TCP/IP. Here we must distinguish between the SMB protocol and the SMB services running on this protocol, as well as NetBIOS and DCE/RPC services that use SMB as an authentication tunnel. We also need to distinguish the "Network Neighborhood" protocol which mainly (but not only) uses NetBIOS datagrams directly.

In 1996, when Sun launched WebNFS[1], Microsoft proposed changing the name of SMB to Common Internet File System[2]. In addition, Microsoft has added many new features, such as symbolic links, hard links, and increased file size. Microsoft is also trying to support direct connections without relying on NetBIOS, but this attempt is still in the experimental stage and needs further improvement. Microsoft proposed a partial definition to the Internet Engineering Task Force as an Internet-Draft.[3] However, these proposals have now expired.

Due to the importance of the SMB protocol for communicating with the dominant Microsoft Windows platform, and the fact that the SMB protocol currently used by the platform has changed significantly compared to the initial version, the Samba project was created to reverse engineer and provide a free software that is compatible with SMB software so that non-Microsoft operating systems can also use it.

In Windows Vista, Microsoft launched Server Message Block 2.0.

【1】Before installation, make sure

(1) The firewall is turned off: Use the command

#systemctl stop iptables.service

If an error message appears, "Failed to stop iptables.service: Unit iptables.service not loaded.", it means that the firewall has not been installed.

(1-1) Install the firewall: (Off topic: During the installation, I could not connect to the Internet. A message "network is unreachable" appeared. I needed to restart the network service network restart)

Use the command:

#yum install iptables-services

After installation, set

#systemctl stop iptables

(2) Disable SELINUX (check SELINUX status: #getenforce)

(2-1) Edit the configuration file

vi /etc/sysconfig/selinux , change the line to SELINUX=disabled

(2-2) Use the setenforce command to set a temporary shutdown

setenforce 0

【2】Install samba

yum install samba samba-client samba-swat

Check the installation status: rpm -qa|grep samba

After the Samba server is installed, the configuration file directory /etc/samba and some other samba executable command tools will be generated

(1) /etc/samba/smb.conf is the core configuration file of samba

(2) /etc/init.d/smb is the startup/shutdown file of samba

【3】Configure the smb.conf file and create a user

(3-1) Configuration (add [tmp] configuration information under Share Definitions)

(3-2) Create a user (eg create a user named apache)

#smbpasswd -a apache

After the modification, restart samba, turn off the firewall, and increase user permissions, otherwise you will not be able to create files and folders in the shared directory

【4】Windows to Linux mapping

Open My Computer -> Map Network Drive -> Enter "\virtual machine ip mp" in the folder column (tmp is the folder set in the configuration file) -> Fill in the created samba username and password in the pop-up window -> Enter the shared directory (the shared directory here is the html directory under www)

*The error "Windows cannot access \ip addr\tmp" may appear, which means that Windows cannot access the virtual machine system

Click Diagnose to view the problem, showing that the virtual machine is not responding

It may be that the virtual machine's firewall was not successfully closed. Use the following command

#systemctl stop firewalld.service

Summarize

The above is the complete guide to building a complete samba server in Linux (centos version) introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

You may also be interested in:
  • How to install and configure samba server under Linux
  • Tutorial on setting up samba server in Linux
  • Linux Samba server super detailed installation and configuration (with problem solving)

<<:  CentOS 6.5 installation mysql5.7 tutorial

>>:  Tutorial on installing MySQL 5.7.18 using RPM package

Recommend

Detailed Analysis of the Selection of MySQL Common Index and Unique Index

Suppose a user management system where each perso...

Comparison of the efficiency of different methods of deleting files in Linux

Test the efficiency of deleting a large number of...

MySQL index principle and query optimization detailed explanation

Table of contents 1. Introduction 1. What is an i...

How to use Vue to implement CSS transitions and animations

Table of contents 1. The difference between trans...

12 Useful Array Tricks in JavaScript

Table of contents Array deduplication 1. from() s...

Implementation of vue+drf+third-party sliding verification code access

Table of contents 1. Background 2. Verification p...

MySQL series: redo log, undo log and binlog detailed explanation

Implementation of transactions The redo log ensur...

How to convert Chinese into UTF-8 in HTML

In HTML, the Chinese phrase “學好好學” can be express...

Detailed explanation of how to use $props, $attrs and $listeners in Vue

Table of contents background 1. Document Descript...

WeChat Mini Program Basic Tutorial: Use of Echart

Preface Let’s take a look at the final effect fir...

js implements custom drop-down box

This article example shares the specific code of ...

How to change the database data storage directory in MySQL

Preface The default database file of the MySQL da...

Web componentd component internal event callback and pain point analysis

Table of contents Written in front What exactly i...