微信关注,获取新知

记录在CentOS7中部署ProFTPD开源FTP服务

对于服务器端的FTP服务器软件,我们可能很多朋友用过vsftpd,但是你有没有听说过ProFTPD?ProFTPD,也是一个Unix平台上或是类Unix平台上的FTP服务器程序,它是在自由软件基金会的版权声明(GPL)下开发、发布的免费软件,也就是说任何人只要遵守GPL版权声明,都可以随意修改源始码。

ProFTPD的全称是Professional FTP Daemon,是针对Wu-FTP的弱项而开发的,软件在经过多年的发展之后完善了很多功能,ProFTP已经成为继Wu-FTP之后最为流行的FTP服务器软件,越来越多的站点选用它构筑安全高效的FTP站点。Proftpd的配置和apache的配置相似,因此该软件也十分容易配置和管理。

在这篇文章中,记录在CentOS7中配置ProFTPD。

1、更新和添加EPEL库

yum update -y

sudo rpm -Uvh http://ftp.astral.ro/mirrors/fedora/pub/epel/beta/7/x86_64/epel-release-7-0.2.noarch.rpm

下载当前启用的yum repos的所有元数据。

sudo yum makecache

2、安装ProFTPD

安装ProFTPD

sudo yum install proftpd

然后再安装FTP

sudo yum install ftp

3、配置系统文件

sudo nano /etc/proftpd.conf

打开编辑:

The file will resemble the following text.

# This is the ProFTPD configuration file

#

# See: http://www.proftpd.org/docs/directives/linked/by-name.html

 

# Server Config – config used for anything outside a <VirtualHost> or <Global> $

# See: http://www.proftpd.org/docs/howto/Vhost.html

 

ServerName “ProFTPD server”

ServerIdent on “FTP Server ready.”

ServerAdmin root@localhost

DefaultServer on

 

# Cause every FTP user except adm to be chrooted into their home directory

# Aliasing /etc/security/pam_env.conf into the chroot allows pam_env to

# work at session-end time (http://bugzilla.redhat.com/477120)

VRootEngine on

DefaultRoot ~ !adm

VRootAlias /etc/security/pam_env.conf etc/security/pam_env$

 

# Use pam to authenticate (default) and be authoritative

AuthPAMConfig proftpd

AuthOrder mod_auth_pam.c* mod_auth_unix.c

# If you use NIS/YP/LDAP you may need to disable PersistentPasswd

#PersistentPasswd off

 

# Don’t do reverse DNS lookups (hangs on DNS problems)

UseReverseDNS off

 

# Set the user and group that the server runs as

User nobody

Group nobody

 

# To prevent DoS attacks, set the maximum number of child processes

# to 20. If you need to allow more than 20 concurrent connections

# at once, simply increase this value. Note that this ONLY works

# in standalone mode; in inetd mode you should use an inetd server

# that allows you to limit maximum number of processes per service

# (such as xinetd)

MaxInstances 20

看到类似的文件。

主要配置指令:

ServerName: FTP服务器的名称。

DefaultRoot:控制用户登录时分配给用户的默认根目录。

MaxInstances:最大同时连接数。

4、添加FTP用户

useradd –shell /bin/false myuser

添加用户。

mkdir /home/myuser

创建一个目录。

chown myuser:myuser /home/myuser/

授权,否则无法写入。

passwd myuser

给FTP用户创建设置密码。

这样,我们重启服务器后用FTP工具就可以用服务器IP,以及我们创建的用户进行FTP连接。

投上你的一票
公众号 「老蒋朋友圈」获取站长新知 / 加QQ群 「706011751」 获取商家优惠推送

未经允许不得转载:老蒋玩运营 » 记录在CentOS7中部署ProFTPD开源FTP服务