Linux运维知识之CentOS 7下安装配置proftpd搭建ftp服务器
小标 2018-12-07 来源 : 阅读 769 评论 0

摘要:本文主要向大家介绍了Linux运维知识之CentOS 7下安装配置proftpd搭建ftp服务器,通过具体的内容向大家展现,希望对大家学习Linux运维知识有所帮助。

本文主要向大家介绍了Linux运维知识之CentOS 7下安装配置proftpd搭建ftp服务器,通过具体的内容向大家展现,希望对大家学习Linux运维知识有所帮助。


proftpd全称:Professional FTP daemon,是针对Wu-FTP的弱项而开发的,除了改进的安全性,还具备许多Wu-FTP没有的特点,能以Stand-alone、xinetd模式运行等。ProFTP已经成为继Wu-FTP之后最为流行的FTP服务器软件,越来越多的站点选用它构筑安全高效的FTP站点,ProFTP配置方便,并有MySQL和Quota模块可供选择,利用它们的完美结合可以实现非系统账号的管理和用户磁盘的限制。<摘抄百度百科>


本章通过下载源码的方式安装,可以到官网下载最新版本://www.proftpd.org/


1、首先安装lrzsz方便拷贝文件到要搭建服务器的linux路径下


yum install lrzsz


2、上传文件解压


将下载完成的proftpd-1.3.6.tar.gz文件上传到指定路径,使用tar zxvf proftpd-1.3.6.tar.gz解压


3、由于使用源码安装,所以需要安装gcc编译环境


yum install gcc gcc-c++ autoconf automake


3、配置并制定安装和配置文件路径


./configure --prefix=/usr/local/proftpd --sysconfdir=/usr/local/proftpd


4、安装


make&make install


5、修改配置文件,限制匿名用户可以上传下载,但是不能删除(本章暂不详细描述权限控制部分内容)


vi /usr/local/proftpd/proftpd.conf


# This is a basic ProFTPD configuration file (rename it to 
# 'proftpd.conf' for actual use.  It establishes a single server
# and a single anonymous login.  It assumes that you have a user/group
# "nobody" and "ftp" for normal operation and anon.

ServerName                      "Welcome to FTP Server"
ServerType                      standalone
DefaultServer                   on

# Port 21 is the standard FTP port.
Port                            21

# Don't use IPv6 support by default.
UseIPv6                         off

# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask                           022

# To prevent DoS attacks, set the maximum number of child processes
# to 30.  If you need to allow more than 30 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                    30

# Set the user and group under which the server will run.
User                            nobody
Group                           nobody

# To cause every FTP user to be "jailed" (chrooted) into their home
# directory, uncomment this line.
#DefaultRoot ~

# Normally, we want files to be overwriteable.
AllowOverwrite          on

IdentLookups            off
UseReverseDNS           off

# Bar use of SITE CHMOD by default
<Limit SITE_CHMOD>
  AllowAll
</Limit>

# A basic anonymous configuration, no upload directories.  If you do not
# want anonymous users, simply delete this entire <Anonymous> section.
<Anonymous /home>
  User                          ftp
  Group                         ftp

  # We want clients to be able to login with "anonymous" as well as "ftp"
  UserAlias                     anonymous ftp

  # Limit the maximum number of anonymous logins
  MaxClients                    50

  # We want 'welcome.msg' displayed at login, and '.message' displayed
  # in each newly chdired directory.
  DisplayLogin                  welcome.msg
  DisplayChdir                  .message

  # Limit WRITE everywhere in the anonymous chroot
  <Limit DELE RMD>
    DenyAll
  </Limit>
</Anonymous>


6、关闭防火墙


systemctl stop firewalld.service

systemctl disable firewalld.service


7、启动服务器


/usr/local/proftpd/sbin/proftpd


查看进程是否已经启动


[root@localhost ~]# ps -ef |grep proftpd
nobody    1140    1  0 12:13 ?        00:00:00 proftpd: (accepting connections)
root      3182  2270  0 12:50 pts/0    00:00:00 grep --color=auto proftpd  


8、添加到启动项避免每次重启后都需要手动启动


vi /etc/rc.d/rc.local


#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.

touch /var/lock/subsys/local
/usr/local/proftpd/sbin/proftpd


由于在CentOS7中/etc/rc.d/rc.local的权限被降低了,所以需要加上可执行的权限:


chmod +x /etc/rc.d/rc.local 


本文由职坐标整理并发布,希望对同学们有所帮助。了解更多详情请关注系统运维Linux频道!

本文由 @小标 发布于职坐标。未经许可,禁止转载。
喜欢 | 0 不喜欢 | 0
看完这篇文章有何感觉?已经有0人表态,0%的人喜欢 快给朋友分享吧~
评论(0)
后参与评论

您输入的评论内容中包含违禁敏感词

我知道了

助您圆梦职场 匹配合适岗位
验证码手机号,获得海同独家IT培训资料
选择就业方向:
人工智能物联网
大数据开发/分析
人工智能Python
Java全栈开发
WEB前端+H5

请输入正确的手机号码

请输入正确的验证码

获取验证码

您今天的短信下发次数太多了,明天再试试吧!

提交

我们会在第一时间安排职业规划师联系您!

您也可以联系我们的职业规划师咨询:

小职老师的微信号:z_zhizuobiao
小职老师的微信号:z_zhizuobiao

版权所有 职坐标-一站式IT培训就业服务领导者 沪ICP备13042190号-4
上海海同信息科技有限公司 Copyright ©2015 www.zhizuobiao.com,All Rights Reserved.
 沪公网安备 31011502005948号    

©2015 www.zhizuobiao.com All Rights Reserved

208小时内训课程