Preface Samba is a free software that implements the SMB protocol on Linux systems, consisting of server and client programs. SMB (Server Messages Block) is a communication protocol for sharing files and printers on a local area network. It provides sharing services for resources such as files and printers between different computers in the local area network. The SMB protocol is a client/server protocol through which the client can access shared file systems, printers, and other resources on the server. For example, I want to share the folder /home/samba with other computers. Install samba yum install -y samba Create samba user useradd samba Modify samba configuration The configuration file is /etc/samba/smb.conf # See smb.conf.example for a more detailed config file or # read the smb.conf manpage. # Run 'testparm' to verify the config is correct after # you modified it. [global] workgroup = SAMBA #samba workgroup, set to Windows workgroup security = user #security options, can be share|user|server|domain, security level increases passdb backend = tdbsam printing = cups printcap name = cups load printers = yes cups options = raw [homes] #By default, the user's home directory will be shared. This is unsafe. You can comment it out with comment = Home Directories valid users = %S, %D%w%S browseable = No read only = No inherit acls = Yes [printers] #Printer sharing comment = All Printers path = /var/tmp printable = Yes create mask = 0600 browseable = No [print$] comment = Printer Drivers path = /var/lib/samba/drivers write list = root create mask = 0664 directory mask = 0775 [rootdir] #Custom shared folder comment = SambaRoot path = /home/samba/ #Shared path read only = No Note: remove the comment after # when modifying it yourself Adding Samba Users Add the samba user you just created and set the corresponding password according to the prompts smbpasswd -a samba The smbpasswd command is used to maintain the user accounts of the Samba server, as follows: // Add Samba user account # smbpasswd -a sambauser // Disable the Samba user account # smbpasswd -d sambauser // Enable Samba user account # smbpasswd -e sambauser // Delete Samba user account # smbpasswd -x sambauser Start Samba Service Start, stop, and view related commands systemctl start smb systemctl stop smb systemctl status smb Windows access shared directories Simply press Win + R, enter \192.168.1.20 in the run interface, which is your Linux host address. The username and password input interface will pop up. Enter the username and password you just set to access it. Frequently asked questions If you access a shared directory in Linux from Windows, you will get a message saying you do not have permission.
Samb also needs to open the following four ports UDP 137, UDP 138, TCP 139, TCP 445 Summarize The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM. You may also be interested in:
|
<<: Ubuntu 18.04 MySQL 8.0 installation and configuration method graphic tutorial
>>: How to print highlighted code in nodejs console
Duplicate form submission is the most common and ...
Comments and messages were originally a great way...
Preface In terms of layout, Gobang is much simple...
Table of contents 1. unzip command 1.1 Syntax 1.2...
Table of contents 1. Basic Concepts 2. Developmen...
Table of contents Breaking down components Left P...
1. Overview There are three ways to create a Dock...
1. Command Introduction The usermod (user modify)...
Preface Before starting this article, let’s do a ...
Table of contents 1. Introduction to PXC 1.1 Intr...
If you want the path following the domain name to...
1. WebDesignerWall 2. Veerle's Blog 3. Tutori...
Problem phenomenon: [root@localhost ~]# docker im...
The requirements are as follows: There are multip...
This article shares the specific code for using j...