CentOS6.5中的vsftpd安装配置

安装ftp

1、使用chkconfig 来查看是否装有vsftpd服务;

2、使用yum命令直接安装:yum -y install vsftpd

3、然后为它创建日志文件:touch /var/log/vsftpd.log

chkconfig --list | grep vsftpd    

      0:off   1:off   2:off   3:off   4:off   5:off   6:off 服务全部都是off的,注意这里的off表示的是服务器启动的时候是否会自启动服务。

启动ftp服务:service vsftpd start

查看ftp服务状态:service vsftpd status

重启ftp服务:service vsftpd restart

关闭ftp服务:service vsftpd stop

3. 配置vsftp服务 编辑/etc/vsftpd/vsftpd.conf文件,

4、添加ftp用户 # adduser -d /var/www/html -g ftp -s /sbin/nologin wlt //-s /sbin/nologin是让其不能登陆系统,-d 是指定用户目录为/var/www/html # passwd wlt

 

CentOS6.5中的ftp

错误1 连接被拒绝,没有任何反应

解决办法: 将端口21放开,修改iptables文件 vim /etc/sysconfig/iptables 重启iptables service iptables restart 查看iptables状态 service iptables status

错误2 500 OOPS: cannot change directory:/home/golduser Login failed.

解决办法: setsebool -P ftp_home_dir on getsebool -a | grep ftp

重启vsftpd的办法

/etc/init.d/vsftpd restart

service vsftpd restart

vsftpd.conf

anonymous_enable=NO

local_enable=YES

write_enable=YES

local_umask=002

xferlog_enable=YES

connect_from_port_20=YES

xferlog_std_format=YES

ascii_upload_enable=YES

ascii_download_enable=YES

#chroot_local_user=YES

chroot_list_enable=YES

chroot_list_file=/etc/vsftpd/chroot_list

listen=YES

pam_service_name=vsftpd

userlist_enable=YES

tcp_wrappers=YES

userlist_enable=YES

userlist_deny=NO

userlist_file=/etc/vsftpd/user_list

注意:

需要将允许ftp登录的用户名写入user_list中。

chroot_list需要自己创建,里面写入不进行chroot的用户名,允许内容为空。

 

 

posted @ 2014-03-27 14:27  zxpo  阅读(582)  评论(0编辑  收藏  举报