Run yum install -y samba to install samba.

Create a Linux user

groupadd smbshare

useradd -g smbshare share

passwd share

Create a Samba user

smbpasswd -a share

Create a directory

mkdir /home/smbshare

chgrp -R smbshare /home/smbshare

chmod g+w smbshare/

4. Modify the configuration file

cp /etc/samba/smb.conf /etc/samba/smb.confbak

vim /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
        security = user
        map to guest = Bad User
        log file = /var/log/samba/log.%m

[shares]
        comment = share
        path = /home/smbshare
# indicates a user group
        valid users = @smbshare
        read only = No

Copy the code

5. Restart the Samba service

systemctl restart smb

Login six.

Access the \\ 192.168.1.202shares address

Log in using the share/share username and password