1.首先就是yum install -y vsftpd 和 yum install -y lftp 下载安装不成功
简单的可以直接在vi /etc/sysconfig/network-scripts/ifcfg-eth0 里面 将
BOOTPROTO=”dhch” 然后Esc 之后:wq 保存退出 shutdown -r now 或者init 6重启虚拟机尝试一番
如果上面不行可以尝试更换yum源 参考于http://yidao620c.iteye.com/blog/1395553 和 http://yidao620c.iteye.com/blog/1395553
首先需要备份一下CentOS-Base.repo
这里由于我之前已经备份过 所以选择n 正常情况下 不会出现询问
vi进入CentOS-Base.repo 进行修改 这里最好使用putty 可以复制 鼠标右键粘贴
#vi /etc/yum.repos.d/Centos-Base.repo
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
baseurl=http://mirrors.163.com/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
baseurl=http://mirrors.163.com/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
baseurl=http://mirrors.163.com/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
# yum clean all
# yum makecache #将服务器上的软件包信息缓存到本地,以提高搜索安装软件的速度
# yum install vim* #测试域名是否可用,同时安装vim 之后安装过程中可以选择n的
如果更新源之后还是不行 一个方法就是 新建虚拟机 后 直接更新源 我刚开始在自己之前建的虚拟机上更新后仍然不行 然后新建的虚拟机
2.防火墙关闭后 重启iptables仍然有数据
首先 服务端和客户端的iptables都需要清空保存,Selinux都需要改为关闭状态 这个上篇博客中有写
#iptables -nvL –line-number 查看详细iptables信息
(1)可以通过 iptables -F 清除 防火墙关闭
(2)关闭iptables 可以通过命令#/etc/init.d/iptables stop 停止
(3)iptables的服务名称也叫iptables可以通过命令#service iptables stop来停止 效果和上条命令一样
(4)可以通过命令#service iptables save保存
(5)虽然通过以上命令关闭了iptables 但是如果设置了自动启动的话 ,重启之后,iptables又自动开启了
(6)所以要关闭自动启动,避免重启后防火墙又启动
#chkconfig iptables off(设置自动启动为关闭)
#chkconfig –del iptables (移除开机自动启动)
正常情况下 两台虚拟机可以ping通 防火墙都关闭的话 ftp服务器端和客户端是可以连接成功的