#这是centos 7cd /etc/yum.repos.d/mkdir backupmv *.repo backup/curl -o CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.reposed -i s|http://mirrors.aliyun.com/centos/7/|http://mirrors.aliyun.com/centos-vault/7.9.2009/|g CentOS-Base.repoyum clean allyum makecache#这是centos 8cd /etc/yum.repos.d/mkdir -p backupmv *.repo backup/ 2/dev/nullcurl -o CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.reposed -i s|mirrors.aliyun.com/centos/8/|mirrors.aliyun.com/centos-vault/8.5.2111/|g CentOS-Base.repoyum clean allyum makecache########################[rootlocalhost ~]# cd /etc/yum.repos.d/[rootlocalhost yum.repos.d]# mkdir backup[rootlocalhost yum.repos.d]# mv *.repo backup/[rootlocalhost yum.repos.d]# curl -o CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo[rootlocalhost 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[rootlocalhost yum.repos.d]# yum clean all[rootlocalhost yum.repos.d]# yum makecache[rootlocalhost yum.repos.d]# yum install samba -y[rootlocalhost yum.repos.d]# firewall-cmd --permanent --add-servicesamba[rootlocalhost yum.repos.d]# firewall-cmd --reload[rootlocalhost yum.repos.d]# systemctl enable firewalld[rootlocalhost yum.repos.d]# setenforce 0[rootlocalhost yum.repos.d]# systemctl enable smb[rootlocalhost yum.repos.d]# systemctl restart smb[rootlocalhost yum.repos.d]# mkdir /share[rootlocalhost yum.repos.d]# touch /share/testfile[rootlocalhost yum.repos.d]# echo this is testfile/share/testfile[rootlocalhost yum.repos.d]# chmod 777 -R /share[rootlocalhost yum.repos.d]# vim /etc/samba/smb.conf[public]commentpublicpath/sharebrowseableyespublicyesread onlyno[rootlocalhost yum.repos.d]# useradd user1[rootlocalhost yum.repos.d]# passwd user1[rootlocalhost yum.repos.d]# smbpasswd -a user1[rootlocalhost yum.repos.d]# systemctl restart smb[rootlocalhost yum.repos.d]# systemctl restart smb nmb################[rootlocalhost yum.repos.d]# yum install samba-client cifs-utils -y[rootlocalhost yum.repos.d]# smbclient -L 192.168.163.130 -U user1%111111[rootlocalhost yum.repos.d]# smbclient //192.168.163.130/public -U user1%111111[rootlocalhost yum.repos.d]# mkdir /mnt/JSEI[rootlocalhost yum.repos.d]# mount -t cifs //192.168.163.130/public /mnt/JSEI -o usernameuser1
SAMBA服务器配置教程——手把手教你
#这是centos 7cd /etc/yum.repos.d/mkdir backupmv *.repo backup/curl -o CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.reposed -i s|http://mirrors.aliyun.com/centos/7/|http://mirrors.aliyun.com/centos-vault/7.9.2009/|g CentOS-Base.repoyum clean allyum makecache#这是centos 8cd /etc/yum.repos.d/mkdir -p backupmv *.repo backup/ 2/dev/nullcurl -o CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.reposed -i s|mirrors.aliyun.com/centos/8/|mirrors.aliyun.com/centos-vault/8.5.2111/|g CentOS-Base.repoyum clean allyum makecache########################[rootlocalhost ~]# cd /etc/yum.repos.d/[rootlocalhost yum.repos.d]# mkdir backup[rootlocalhost yum.repos.d]# mv *.repo backup/[rootlocalhost yum.repos.d]# curl -o CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo[rootlocalhost 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[rootlocalhost yum.repos.d]# yum clean all[rootlocalhost yum.repos.d]# yum makecache[rootlocalhost yum.repos.d]# yum install samba -y[rootlocalhost yum.repos.d]# firewall-cmd --permanent --add-servicesamba[rootlocalhost yum.repos.d]# firewall-cmd --reload[rootlocalhost yum.repos.d]# systemctl enable firewalld[rootlocalhost yum.repos.d]# setenforce 0[rootlocalhost yum.repos.d]# systemctl enable smb[rootlocalhost yum.repos.d]# systemctl restart smb[rootlocalhost yum.repos.d]# mkdir /share[rootlocalhost yum.repos.d]# touch /share/testfile[rootlocalhost yum.repos.d]# echo this is testfile/share/testfile[rootlocalhost yum.repos.d]# chmod 777 -R /share[rootlocalhost yum.repos.d]# vim /etc/samba/smb.conf[public]commentpublicpath/sharebrowseableyespublicyesread onlyno[rootlocalhost yum.repos.d]# useradd user1[rootlocalhost yum.repos.d]# passwd user1[rootlocalhost yum.repos.d]# smbpasswd -a user1[rootlocalhost yum.repos.d]# systemctl restart smb[rootlocalhost yum.repos.d]# systemctl restart smb nmb################[rootlocalhost yum.repos.d]# yum install samba-client cifs-utils -y[rootlocalhost yum.repos.d]# smbclient -L 192.168.163.130 -U user1%111111[rootlocalhost yum.repos.d]# smbclient //192.168.163.130/public -U user1%111111[rootlocalhost yum.repos.d]# mkdir /mnt/JSEI[rootlocalhost yum.repos.d]# mount -t cifs //192.168.163.130/public /mnt/JSEI -o usernameuser1