Setup and Configure the vsftpd server in CentOS 7 operation system
##############################################################################
1. close the firewall service
=====THE COMMAND YOU CAN TYPE INTO YOUR CONSOLE======
#systemctl stop firewalld.service //stop the firewall service
#systemctl disable firewalld.service //disable it to luanch when the system starts up
##############################################################################
2. install iptables
=====THE COMMAND YOU CAN TYPE INTO YOUR CONSOLE======
#yum install iptables iptables-services //install iptables
#vim /etc/sysconfig/iptables //edit iptables' configuration file
# Firewall configuration written by system-config-firewall # Manual customization of this file is not recommended. *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT -A INPUT -p icmp -j ACCEPT -A INPUT -i lo -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 10060:10090 -j ACCEPT -A INPUT -j REJECT --reject-with icmp-host-prohibited -A FORWARD -j REJECT --reject-with icmp-host-prohibited COMMIT
Type <- :wq! -> to save it and leave it out.
=====THE COMMAND YOU CAN TYPE INTO YOUR CONSOLE======
#systemctl restart iptables.service //restart the firewall for taking effect
#systemctl enable iptables.service //configure the iptables service automatically reboot when the system starts up
Notice that: 21 port is the FTP server's port, however, the ports which are needed on the passive mode of the vsftpd are from 10060 port to 10090 port , these ports you can define by yourself, it is up to you.
##############################################################################
3. Close SELINUX
vim /etc/selinux/config
#SELINUX=enforcing #SELINUXTYPE=targeted SELINUX=disabled
:wq! to save and leave it out.
=====THE COMMAND YOU CAN TYPE INTO YOUR CONSOLE======
#setenforce 0 //Enable configuration to take effect immediately
##############################################################################
4. Install vsftpd
=====THE COMMAND YOU CAN TYPE INTO YOUR CONSOLE======
#yum install -y vsftpd //install vsftpd
#yum install -y psmisc net-tools systemd-devel libdb-devel perl-DBI
# systemctl start vsftpd.service
#systemctl enable vsftpd.service
##############################################################################
5. Configure vsftpd server's configuation file
=====THE COMMAND YOU CAN TYPE INTO YOUR CONSOLE======
#cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.backup
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
anon_upload_enable=NO
anon_mkdir_write_enable=YES
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
chown_uploads=YES
#xferlog_file=/var/log/xferlog
xferlog_std_format=YES
idle_session_timeout=300
data_connection_timeout=1
#nopriv_user=ftpsecure
async_abor_enable=YES
ascii_upload_enable=YES
ascii_download_enable=YES
ftpd_banner=Welcome to blah FTP service.
#deny_email_enable=YES
#banned_email_file=/etc/vsftpd/banned_emails
chroot_local_user=YES
#chroot_list_enable=YES
#chroot_list_file=/etc/vsftpd/chroot_list
#ls_recurse_enable=YES
listen=NO
listen_ipv6=YES
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
use_localtime=YES
listen_port=21
guest_enable=YES
guest_username=vsftpd
user_config_dir=/etc/vsftpd/vconf
virtual_use_local_privs=YES
pasv_min_port=10060
pasv_max_port=10090
accept_timeout=5
connect_timeout=1
allow_writeable_chroot=YES
##############################################################################
6. create a virtual user list file
=====THE COMMAND YOU CAN TYPE INTO YOUR CONSOLE======
#touch /etc/vsftpd/virtusers
#vim /etc/vsftpd/virtusers
web1 123456 web2 123456 web3 123456
:wq! to save and leave it out.
##############################################################################
7. generate a virtual user data file
=====THE COMMAND YOU CAN TYPE INTO YOUR CONSOLE======
#db_load -T -t hash -f /etc/vsftpd/virtusers /etc/vsftpd/virtusers.db
#chmod 600 /etc/vsftpd/virtusers.db
##############################################################################
8. Edit /etc/pam.d/vsftpd file and add some information as below
=====THE COMMAND YOU CAN TYPE INTO YOUR CONSOLE======
#cp /etc/pam.d/vsftpd /etc/pam.d/vsftpd.backup
#vim /etc/pam.d/vsftpd
auth sufficient /lib64/security/pam_userdb.so db=/etc/vsftpd/virtusers account sufficient /lib64/security/pam_userdb.so db=/etc/vsftpd/virtusers
Note that: if your system is 32bit system, you can modify lib64 into lib, or you will fail to configure it correct.
##############################################################################
9. Create a system user vsftpd, its home directory is /home/wwwroot, set user login console as /bin/false (in order to disable its login function)
=====THE COMMAND YOU CAN TYPE INTO YOUR CONSOLE======
#useradd vsftpd -m -d /home/wwwroot -s /bin/false
##############################################################################
10. Create the configuration file for the virtual user vsftpd
=====THE COMMAND YOU CAN TYPE INTO YOUR CONSOLE======
#mkdir /etc/vsftpd/vconf
#cd /etc/vsftpd/vconf
#touch web1 web2 web3
#mkdir -p /home/wwwroot/web1/http/
#mkdir -p /home/wwwroot/web2/http/
#mkdir -p /home/wwwroot/web3/http/
#vim web1
local_root=/home/wwwroot/web1/http/ write_enable=YES anon_world_readable_only=NO anon_upload_enable=YES anon_mkdir_write_enable=YES anon_other_write_enable=YES
#vim web2
local_root=/home/wwwroot/web2/http/ write_enable=YES anon_world_readable_only=NO anon_upload_enable=YES anon_mkdir_write_enable=YES anon_other_write_enable=YES
#vim web3
local_root=/home/wwwroot/web3/http/ write_enable=YES anon_world_readable_only=NO anon_upload_enable=YES anon_mkdir_write_enable=YES anon_other_write_enable=YES
##############################################################################
11. Restart vsftpd server
=====THE COMMAND YOU CAN TYPE INTO YOUR CONSOLE======
#systemctl restart vsftpd.service
##############################################################################
Thank you for your reading!
That's all, at the same time, it's my pleasure to share something I know, hope it will be helpful for you.
##############################################################################
Setup and Configure the vsftpd server in CentOS 7 operation system的更多相关文章
- Setup VSFTPD Server with Virtual Users On CentOS, RHEL, Scientific Linux 6.5/6.4/6.3
We have already shown you How to Setup VSFTPD Server on CentOS 6.5/6.4 in our previous article. In t ...
- Setup FTP Server On CentOS, RHEL, Scientific Linux 6.5/6.4/6.3
setsebool allow_ftpd_full_access onsetsebool -P ftp_home_dir on vsftpd (Very Secure File Transport P ...
- setup FTP server on CentOS 7
Setup FTP Server on CentOS 7 Install vsftpd vsftpd (Very Secure File Transport Protocol Daemon) is a ...
- Setup Git Server in CentOS 6.3
0. Environment: Server machine: CentOS 6.3 x86 Client machine: Windows 10 Pro x86_64 1. Install ssh ...
- Installing MySQL Server on CentOS
MySQL is an open-source relational database. For those unfamiliar with these terms, a database is wh ...
- How to: Set up Openswan L2TP VPN Server on CentOS 6
Have you ever wanted to set up your own VPN server? By following the steps below, you can set up you ...
- Install RabbitMQ server in CentOS 7
About RabbitMQ RabbitMQ is an open source message broker software, also sometimes known as message-o ...
- Tigase XMPP Server在CentOS部署和配置
Tigase XMPP Server在CentOS部署与配置 作者:chszs,转载需注明.博客主页:http://blog.csdn.net/chszs 以下讲述Tigase XMPP Server ...
- You must configure either the server or JDBC driver (via the serverTimezone configuration property
使用JDBC连接MySql时出现:The server time zone value '�й���ʱ��' is unrecognized or represents more than one ...
随机推荐
- git记录用户名
windows下比较比较好用的Git客户端有2种: 1. msysgit + TortoiseGit(乌龟git) 2. GitHub for Windows github的windows版也用过一段 ...
- 百度编辑器不能插入html标签解决方法
找到此方法: me.addInputRule(function (root) { var allowDivTransToP = this.options.allowDivTransToP; var v ...
- java web项目修改favicon.ico图标的方式
1.修改整个项目的tomcat图标 找到tomcat的根目录(tomcat-webapps-ROOT目录),然后将修改的favicon.ico图标覆盖掉本地的图标,然后再重启项目,刷新,清除浏览器缓存 ...
- python 部署 Restful web
使用python web做Restful 风格,很简单,采用Flask框架轻松实现一个RESTful的服务. Restful相关介绍请查看:https://www.ibm.com/developerw ...
- ng-file-upload(在单文件选择,并且通过点击“上传”按钮上传文件的情况下,如何在真正选择文件之前保留上一文件信息?)
文章前面研究ng-file-upload可能涉及指令: You can use ng-model or ngf-change instead of specifying function for ng ...
- 这家IT教育公司太拼了:毕业生找不到工作就全额退学费!
乐橙谷为了让更多的学生有工作,有高薪工作,已经决定尝试一种更刺激的游戏规则:完成课时的学员如果毕业找不到工作,公司将全额退还学费.这家公司秉承着自己的使命:以尊重的文化,敬畏的心态去努力帮助每个学生实 ...
- Dice (II) (DP)唉,当时没做出来
Dice (II) Time Limit: 3000MS Memory Limit: 32768KB 64bit IO Format: %lld & %llu [Submit] [ ...
- redis C接口hiredis 简单函数使用介绍
hiredis是redis数据库的C接口,目前只能在linux下使用,几个基本的函数就可以操作redis数据库了. 函数原型:redisContext *redisConnect(const char ...
- 概率图模型PGM——D map, I map, perfect map
若F分布的每个条件独立性质都反映在A图中,则A图被称为F分布的D map. 若A图表现出的所有条件独立性质都在F分布中满足(与F分布不矛盾),则A图被称为F分布的I map. 弱A图既是F分布的D m ...
- Ubuntu 16.04 源码编译安装PHP7
一.下载PHP7的最新版源码 php7.0.9 下载地址 http://php.net/get/php-7.0.9.tar.gz/from/a/mirror 二.解压 tar -zxf /tmp/p ...