The early network wants to share files between different hosts to use the FTP protocol to transfer, but the FTP protocol can only be transferred files but not directly modify the other host data, so it is not very convenient, so there is an NFS open source file sharing program, NFS is a service that can attach multiple Linux remote host data to a local directory, is a lightweight file sharing service, and does not support file sharing between Linux and Windows systems.
The Samba service program is an open source file sharing software that is based on the SMB protocol and consists of a server and a client, enabling file sharing between Linux and Windows systems.
1. SMB implements Linux with Windows file sharing
(1) Check whether the current user authentication mode
Security == Tdbsam
(2) Create a shared folder
Mkdir/home/fate/sharedir
(3) Adding shared folder information
Cd/etc/samba/smb.conf
[Fate0729]comment= Do notarbitrarily modify the database filepath=/home/fate/sharedir public =nowritable=yes[sharedir]comment= does notarbitrarily modify the database filepath =/home/fate/sharedirpublic =nowritable=yes
(4) Restart the SMB service after saving the smb.conf file
Systemctl Restart SMB
(5) Add boot entry
Systemctl Enable SMB
(6) Clear the firewall rule chain
Iptables-fservice iptables Save
(7) Create an SMB service standalone account
Pdbedit-a-U Fate
(8) Running the SELinux rule
// set the owner and all groups of the shared directory to fate user chown-rf fate:fate/home/fate/sharedir// Boolean value that allows SELinux to share home directories for SMB users setsebool-P samba_enable_home_dirson// Set the SELinux security context for the shared directory properly semanage fcontext-a-t samba_share_t/home/fate/sharedir// Make the new security context effective immediately Restorecon-rv/home/fate/sharedir
2. Testing
(1) Enter the Linux host IP \\192.168.3.10 at the command line
(2) Login account password
Linux uses Samba for file sharing