Install vsftpd
1. Execute the following command as an administrator (root)
yum install vsftpd
2. Set the boot vsftpd ftp service
chkconfig vsftpd on
3. Start the vsftpd service
service vsftpd start
Manage vsftpd related commands: stop vsftpd: service vsftpd stop Restart vsftpd: service vsftpd restart Configure the firewall Open the /etc/sysconfig/iptables file vi /etc/sysconfig/iptables Add the following code before the REJECT line -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp - -dport 21 -j ACCEPT Save and close the file, restart the firewall service iptables start Configure the vsftpd server The default configuration file is /etc/vsftpd/vsftpd.conf, you can open it with a text editor. vi /etc/vsftpd/vsftpd.conf Add ftp user The following is to add the ftpuser user, set the root directory to /home/wwwroot/ftpuser, prohibit this user from logging in to SSH, and restrict his access to other directories.
1、修改/etc/vsftpd/vsftpd.conf
将底下三行
#chroot_list_enable=YES
# (default follows)
#chroot_list_file=/etc/vsftpd.chroot_list
改为
chroot_list_enable=YES
# (default follows)
chroot_list_file=/etc/vsftpd/chroot_list
3、增加用户ftpuser,指向目录/home/wwwroot/ftpuser,禁止登录SSH权限。
useradd -d /home/wwwroot/ftpuser -g ftp -s /sbin/nologin ftpuser
4、设置用户口令
passwd ftpuser
5、编辑文件chroot_list:
vi /etc/vsftpd/chroot_list
内容为ftp用户名,每个用户占一行,如:
peter
john
6、重新启动vsftpd
service vsftpd restart
安装nginx:
http://blog.csdn.net/forever_forest/article/details/8994360
nginx配置文件 vi /usr/local/nginx/conf/nginx.conf 修改location root指定ftp上传文件的默认目录:
location / {
root /home/ftp/upload;
index index.html index.htm;
}
关闭selinux
/usr/sbin/setenforce 0
vi /etc/selinux/config
SELINUX=disabled