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

Solve the problem of Docker starting Elasticsearch7.x and reporting an error

Using the Docker run command docker run -d -p 920...

Nginx solves cross-domain issues and embeds third-party pages

Table of contents Preface difficulty Cross-domain...

Linux automatic login example explanation

There are many scripts on the Internet that use e...

Solution to win10 without Hyper-V

Are you still looking for a way to enable Hyper-v...

How to set a fixed IP address for a VMware virtual machine (graphic tutorial)

1. Select Edit → Virtual Network Editor in the me...

Mobile development tutorial: Summary of pixel display issues

Preface I believe that in the process of mobile t...

Automatically install the Linux system based on cobbler

1. Install components yum install epel-rpm-macros...

Use and optimization of MySQL COUNT function

Table of contents What does the COUNT function do...

Extract specific file paths in folders based on Linux commands

Recently, there is a need to automatically search...

js implements the algorithm for specifying the order and amount of red envelopes

This article shares the specific code of js to im...

HTML special character conversion table

character Decimal Character Number Entity Name --...

Detailed explanation of basic interaction of javascript

Table of contents 1. How to obtain elements Get i...

Analysis of Linux boot system methods

This article describes how to boot the Linux syst...

jQuery implements simple pop-up window effect

This article shares the specific code of jQuery t...