1. 安装
Yuminstall vsftpd 或者 yum –y install vstfpd
如果出现:Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=5&arch=i386&repo=oserror was…..
[以下解决方案源于:http://blog.sina.com.cn/s/blog_65f64cc70100qrgk.html
yum update时候出现Another app is currently holding the yum lock解决方法
[root@localhostwangcheng]# yum install yumex Existing lock /var/run/yum.pid: another copy isrunning as pid 3807. Another app is currently holding the yum lock; waiting for it to exit...Another app is currently holding the yum lock; waiting for it to exit... Another app iscurrently holding the yum lock; waiting for it to exit... Another app is currently holdingthe yum lock; waiting for it to exit... Another app is currently holding the yum lock;waiting for it to exit... Another app is currently holding the yum lock; waiting for it to exit... Another app is currently holding the yum lock; waiting for it to exit... Another appis currently holding the yum lock; waiting for it to exit... Another app is currentlyholding the yum lock; waiting for it to exit... Another app is currently holding the yumlock; waiting for it to exit... 这是什么原因? /var/run/yum.pid我打开看了,只是一个数,其他的可能是系统自动升级正在运行,所以yum被锁定了。 可以通过执行rm -rf /var/run/yum.pid 来强行解除锁定,然后你的yum就可以运行了。]
表示没有配置resolv.conf
解决方法:
Vi/etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4
search localdomain
保存再执行 yum install vsftpd 即可
2. 修改配置文件
#vi/etc/vsftpd/vsftpd.conf
anonymous_enable=NO//是否开启匿名登录
local_enable=YES//是否允许本地用户登录
write_enable=YES//是否允许上传
local_umask=022//默认的umask码
diremssage_enable=YES//是否显示目录说明文件,默认是YES但需要收工创建.message文件
xferlog_enable=YES//是否记录ftp传输过程
connect_from_prot_20=YES//是否确定端口传输来自20
xferlog_ftd_format=YES//是否使用标准的ftp xferlog模式
chroot_list_enable=YES//是否将系统用户限制在自己的home目录下
chroot_list_file=/etc/vsftpd/chroot_list//列表不受限制的用户
listen=YES//中否开启监听
pam_service_name=vsftpd// 服务名称
userlist_enable=YES//
tcp_wrappers=YES//
3. 修改Selinux对ftp服务的保护
#setseboolftpd_disable_trans 1 //关闭Selinux对ftp服务的保护
#vi/etc/selinux/config
SELINUX=disable//将此处设置为disable
#servicevsftpd restart 重启vsftpd服务
4. 关闭防火墙
#serviceiptables stop
5. 添加用户
#useradd –d/var/zsl/ftp/zsl –s /sbin/nologin zsl //新增用户zsl不让在本机登陆(注意要先创建目录:/var/zsl/ftp,mkdir /var/zsl/ftp -p)
#chown –Rzsl /var/zsl/ftp/zsl 更改新增目录的权限,只允许zsl访问
#chmod777 –R /var/zsl/ftp/zsl 更改访问权限
#passwdzsl //修改密码111111
6. 设置该用户是否锁定在自己目录中
#vi/etc/vsftpd/chroot_list //把zsl添加到该文件中
7. 设置vsfptd开机启动
#chkconfig–list | grep vsftpd //查找vsftpd
#chkconfig–level 2345 vsftpd on //把2345这几个级别都开启