CentOS下vsftpd的安装配置

本文源于:http://wenku.baidu.com/link?url=SJw6IxZAEPA8jNnoGuLxMCD6BoTzEGRaj2CVoVSneDfPGuKbO2bjxGYMkIhqRHu8rh_ZWYh9OD3WYuNyBZsxd_TmCiGP9y-RG4IKL-0cogS

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 lockwaiting for it to exit...Another app is currently holding the yum lockwaiting for it to exit... Another app iscurrently holding the yum lockwaiting for it to exit... Another app is currently holdingthe yum lockwaiting for it to exit... Another app is currently holding the yum lock;waiting for it to exit... Another app is currently holding the yum lockwaiting for it to exit... Another app is currently holding the yum lockwaiting for it to exit... Another appis currently holding the yum lockwaiting for it to exit... Another app is currentlyholding the yum lockwaiting for it to exit... Another app is currently holding the yumlockwaiting 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这几个级别都开启

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值