转自:http://stevenfeng.iteye.com/blog/1117254
1.检查是否安装
rpm -q vsftpd-2.0.5-16.el5.i386.rpm
或 rpm -qa|grep vsftpd
2.如果没安装,安装
rpm -ivh vsftpd-2.0.5-16.el5.i386.rpm
或者
yum install vsftpd
chkconfig --list|grep vsftpd
如需修改配置文件:vi /etc/init.d/vsftpd
启动 /etc/init.d/vsftpd start
===========================================================
centos7 安装vsftpd的步骤
http://www.tuicool.com/articles/RR3aEb3
#官网配置说明##
https://security.appspot.com/vsftpd/vsftpd_conf.html
##需求##
1)登录FTP 只能看到当前用户的,不能跨越到主目录
2)禁止匿名用户登录FTP
3)修改FTP 监听端口号!
yum install vsftpd
ps auxf | grep vsftpd
systemctl start vsftpd
systemctl stop vsftpd
systemctl status vsftpd
1)无法启动 systemctl stop vsftpd --> 成功过,第二行 systemctl start vsftpd ==> 一直报错一直报错
2)禁用匿名用户,本来一开始就修改了vsftpd.conf,但是怎么都无法重启无法生效。现在手动杀死进程才可以。
3)锁定在根目录,禁止local用户跳出根目录。测试了很多次最后这一行才可以:
chroot_local_user=YES
allow_writeable_chroot=YES
chroot_list_enable=YES
# (default follows)
#chroot_list_file=/etc/vsftpd/chroot_list
http://www.cnblogs.com/lyongde/p/3187711.html
4)修改监听端口号:配置文件结尾加入新的端口号,listen_port=801,然后重启!
===添加用户
useradd -d /usr/local/openresty/nginx/golomee ftp_user_golomee //添加用户
usermod -s /sbin/nologin ftp_user_golomee //限定用户ftp_user_golomee不能telnet,只能ftp
usermod -d /usr/local/openresty/nginx/golomee ftp_user_golomee //更改用户test的主目录为/test
passwd ftp_user_golomee //设置密码
chmod -R 777 /usr/local/openresty/nginx/golomee
chown -R ftp_user_golomee /usr/local/openresty/nginx/golomee
============================================================================================================
安装脚本
============================================================================================================
#!/bin/bash
#add ftp_user_golomee
useradd -d /usr/local/openresty/nginx/golomee ftp_user_golomee
usermod -s /sbin/nologin ftp_user_golomee
usermod -d /usr/local/openresty/nginx/golomee ftp_user_golomee
chmod -R 777 /usr/local/openresty/nginx/golomee
chown -R ftp_user_golomee /usr/local/openresty/nginx/golomee
passwd ftp_user_golomee
#install vsftpd
#rpm -qa|grep vsftpd
yum install vsftpd
#vi vsftpd.conf http://www.cnblogs.com/lyongde/p/3187711.html
vi /etc/vsftpd/vsftpd.conf
#anonymous_enable=NO
#chroot_local_user=YES
#allow_writeable_chroot=YES
#chroot_list_enable=YES
## (default follows)
##chroot_list_file=/etc/vsftpd/chroot_list
#command
#ps auxf | grep vsftpd
#systemctl start vsftpd
#systemctl stop vsftpd
#systemctl status vsftpd
#systemctl restart vsftpd