#这是centos 7
cd /etc/yum.repos.d/
mkdir backup
mv *.repo backup/
curl -o CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
sed -i 's|http://mirrors.aliyun.com/centos/7/|http://mirrors.aliyun.com/centos-vault/7.9.2009/|g' CentOS-Base.repo
yum clean all
yum makecache
#这是centos 8
cd /etc/yum.repos.d/
mkdir -p backup
mv *.repo backup/ 2>/dev/null
curl -o CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
sed -i 's|mirrors.aliyun.com/centos/8/|mirrors.aliyun.com/centos-vault/8.5.2111/|g' CentOS-Base.repo
yum clean all
yum makecache
########################
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# mkdir backup
[root@localhost yum.repos.d]# mv *.repo backup/
[root@localhost yum.repos.d]# curl -o CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
[root@localhost yum.repos.d]# sed -i 's|http://mirrors.aliyun.com/centos/7/|http://mirrors.aliyun.com/centos-vault/7.9.2009/|g' CentOS-Base.repo
[root@localhost yum.repos.d]# yum clean all
[root@localhost yum.repos.d]# yum makecache
[root@localhost yum.repos.d]# yum install samba -y
[root@localhost yum.repos.d]# firewall-cmd --permanent --add-service=samba
[root@localhost yum.repos.d]# firewall-cmd --reload
[root@localhost yum.repos.d]# systemctl enable firewalld
[root@localhost yum.repos.d]# setenforce 0
[root@localhost yum.repos.d]# systemctl enable smb
[root@localhost yum.repos.d]# systemctl restart smb
[root@localhost yum.repos.d]# mkdir /share
[root@localhost yum.repos.d]# touch /share/testfile
[root@localhost yum.repos.d]# echo this is testfile>/share/testfile
[root@localhost yum.repos.d]# chmod 777 -R /share
[root@localhost yum.repos.d]# vim /etc/samba/smb.conf
[public]
comment=public
path=/share
browseable=yes
public=yes
read only=no
[root@localhost yum.repos.d]# useradd user1
[root@localhost yum.repos.d]# passwd user1
[root@localhost yum.repos.d]# smbpasswd -a user1
[root@localhost yum.repos.d]# systemctl restart smb
[root@localhost yum.repos.d]# systemctl restart smb nmb
################
[root@localhost yum.repos.d]# yum install samba-client cifs-utils -y
[root@localhost yum.repos.d]# smbclient -L 192.168.163.130 -U user1%111111
[root@localhost yum.repos.d]# smbclient //192.168.163.130/public -U user1%111111
[root@localhost yum.repos.d]# mkdir /mnt/JSEI
[root@localhost yum.repos.d]# mount -t cifs //192.168.163.130/public /mnt/JSEI -o username=user1