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
There are many MySQL variables, some of which are...
You may remember that in the past articles we hav...
Table of contents 1. What to debug 2. Features of...
This article example shares the specific code of ...
The Raspberry Pi model is 4b, 1G RAM. The system ...
Preface Before we begin, we should briefly unders...
Preface Recently, a Java EE web project that has ...
Let's take a look at ufw (Uncomplicated Firew...
We often encounter this situation when doing devel...
◆Add to favorites illustrate Click to add your we...
1. A container is an independently running applic...
Table of contents Preface How does antd encapsula...
background The interface domain name is not hard-...
We often want to find a file in Linux, but we don...
Table of contents Preface Stored Procedure: 1. Cr...