First, the service side
1. Install the Samba package
Yum-y Install Samba
2. Add Samba Account
Useradd-s/sbin/nologin Harry
Pdbedit-a Harry//Enter Password 2 times
3. Modify the Configuration
Vim/etc/samba/smb.conf
Add in last line
[Common]
Path =/common
Second, the client
Installing the Client software: smb-client
To view the server-side shared folders: smbclient-l//172.25.0.11 password is not entered, press ENTER directly
Command line view: Smbclient-u Harry//172.25.0.11/common
Note that this is where selinux blocks viewing and read-write permissions and needs to be set
[Email protected] ~]# Getsebool-a | grep Samba
Samba_export_all_ro-On
SAMBA_EXPORT_ALL_RW-On
General use Mount view: Required Packages: Cifs-utils
_netdev: Mount the device after you open the Network service
To modify a configuration file:
Vim/etc/fstab
172.25.0.11/common/mnt/samba CIFS User=zsq,pass=123,_netdev 0 0
Verify:
Mount-a
Df-h
If you want to set up read-write, add the samba.conf after the server
Write list = zsq
Then set ZSQ Local read-write permission, we recommend using Setfacl
####################################
Multiuser Multi-user access
The client modifies the configuration file:
172.25.0.11/common/mnt/samba CIFS USER=ZSQ,PASS=123,_NETDEV,MULTIUSER,SEC=NTLMSSP 0 0
Re-mount
Umount/mnt/samba
Mount-a
Verify:
Su-student
Cd/mnt/samba
Cifscreds add-u zsq 172.25.0.11 Enter password
Touch C.txt
Linux Shared Folders Samba