标签:list bin 文件 关闭 光驱 date eve recorder url
CentOS 6.* 配置本地网络yum源一台服务时只需要配一个本地的yum源即可;
当需要配置多台服务器时,只需要配置1到2台vsftpd的yum源,其它服务器通过ftp连接yum源;
wget -b https://mirrors.aliyun.com/centos/6.10/isos/x86_64/CentOS-6.10-x86_64-bin-DVD1.iso
tail -100f wget-log
ll /mnt # 确保/mnt目录下没有文件;
mount -o loop CentOS-6.5-x86_64-bin-DVD1.iso /mnt
或者挂载光驱
mount /dev/cdrom? /mnt
[root@node1 ~]# cd /etc/yum.repos.d/
[root@node1 yum.repos.d]# mv CentOS-Base.repo{,_bak}
[root@node1 yum.repos.d]# cp -a CentOS-Media.repo{,_bak}
[root@node1 yum.repos.d]# vim CentOS-Media.repo
修改内容如下:
[c6-media]
name=CentOS-$releasever - Media
baseurl=file:///media/CentOS/
file:///media/cdrom/
file:///media/cdrecorder/
gpgcheck=0 # 关闭校验
enabled=1 # 启用
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
复制镜像文件内容到/etc/yum.repos.d/CentOS-Media.repo配置文件里写的路径下:
cp -a /mnt/* /media/CentOS/
yum clean all
yum makecache
yum install lrzsz -y
cd /mnt/Packages/
rpm -ivh lrzsz-0.12.20-27.1.el6.x86_64.rpm
修改ftp的根目录只要修改/etc/vsftpd/vsftpd.conf文件即可:
cp -a /etc/vsftpd/vsftpd.conf{,_$(date +%F)}
vim /etc/vsftpd/vsftpd.conf
加入如下内容:
anon_root=/var/ftp/
local_root=/var/ftp/
chroot_local_user=YES
注:local_root 针对系统用户;
? ? anon_root 针对匿名用户。
service vsftpd start
chkconfig vsftpd on
chkconfig --list|grep vsftpd
[root@node1 ~]# cd /etc/yum.repos.d/
[root@node1 yum.repos.d]# mv CentOS-Base.repo{,_bak}
[root@node1 yum.repos.d]# cp -a CentOS-Media.repo{,_bak}
[root@node1 yum.repos.d]# vim CentOS-Media.repo
修改内容如下:
[c6-media]
name=CentOS-$releasever - Media
baseurl=file:///var/ftp/pub/centos6
gpgcheck=0 # 关闭校验
enabled=1 # 启用
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
创建相应目录
mkdir -pv /var/ftp/pub/centos6
复制镜像文件内容到/etc/yum.repos.d/CentOS-Media.repo配置文件里写的路径下:
cp -a /mnt/* /var/ftp/pub/centos6
[root@node1 ~]# cd /etc/yum.repos.d/
[root@node1 yum.repos.d]# mv CentOS-Base.repo{,_bak}
[root@node1 yum.repos.d]# cp -a CentOS-Media.repo{,_bak}
[root@node1 yum.repos.d]# vim CentOS-Media.repo
修改内容如下:
[c6-media]
name=CentOS-$releasever - Media
baseurl=ftp://192.168.1.101/pub/centos6
gpgcheck=0 # 关闭校验
enabled=1 # 启用
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
假设vsftpd服务端的IP为:192.168.1.101
yum clean all
yum makecache
yum install lrzsz -y
yum install wget telnet -y
mv /etc/yum.repos.d/CentOS-Base.repo{,_$(date +%F)}
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum clean all
yum makecache
标签:list bin 文件 关闭 光驱 date eve recorder url
原文地址:http://blog.51cto.com/moerjinrong/2330693