Installation and configuration of samba service under linux CentOS

In the past, when we shared files on windows, we just need to right-click on the folder to be shared and select the options related to sharing. But how to realize the file sharing between windows and linux? This involves the samba service, this software is not difficult to configure, and it is very simple to use

One, install samba service

1. Normally, the system should already have its own samba

Enter the command to check whether the samba service is installed locally. It can be seen from the figure that samba has been installed on the machine (if not installed, it will not be displayed)
rpm -qa | grep samba
Insert picture description here

2. If not installed, you can install it through yum (please see another blog for yum configuration)

Use yum to install ps: Of course you can also use rpm, I prefer to use yum
yum install -y samba samba-client

Second, configure the shared Samba server

The so-called shared Samba server does not require authentication, similar to anonymous FTP.

1. First, back up the configuration file. It is recommended that newcomers can develop this good habit

cp smb.conf smb.conf.bak

2. Detailed explanation of samba configuration file

(1) smb.conf file, detailed explanation of the main configuration file
[global]: global settings
[homes]: user directory sharing settings
[printers]: printer sharing settings
[myshare]: custom-named shared directory settings.
Others are omitted, buckle I’m tired of writing to see other bloggers. There are many detailed explanations. I mainly want to help people get this service.

3. Edit the file smb.conf

Add the following command at the bottom of the configuration file

[myshare]
	comment = Lvan fu   #喜欢啥打啥吧,就是起个名字
	path = /home/share  #共享文件的目录,共享哪个打哪个
	public = yes        #你得让访问啊,所以是yes
	writable = yes      #指定该路径是否可写
	printable = no      #是否允许打印,反正我不想允许,我就NO,需要的话可以YES
	create mask = 0765  #建立文件时所给的权限
	security = share    #是否需要用户名密码,详情请看其他博主,我是不想用

4. Restart the service

systemctl start smb

Three, configure user-based samba server

I'm tired, I'll post it tomorrow. . .

Guess you like

Origin blog.csdn.net/LvanFu/article/details/103228245