proftpd的搭建以及相关配置

配置文件在etc/proftpd.conf,配置文件说明如下:

ServerName                     "ProFTPD Default Installation"
ServerType                     standalone
DefaultServer                  on

分别表示:服务器名称,服务类型和默认服务状态!

后面的服务端口啊什么的我就省去不说了,说最关键的权限控制部分。

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

注意看上面:以什么用户和什么组来运行服务。

更改为你现有的组和用户,这里为了管理上的方便和安全性上考虑,建议新建一个ftp组和ftp用户。

# To cause every FTP user to be "jailed" (chrooted) into their
home
# directory, uncomment this line.
#DefaultRoot ~
是否允许用户进入用户的主目录,注意:可是适用/home替代

# Normally, we want files to be overwriteable.
AllowOverwrite         on
是否具有重写的权利

# A basic anonymous configuration, no upload
directories. If you do not
# want anonymous users, simply delete this entire
<Anonymous> section.
<Anonymous ~ftp>
 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                   10

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

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

这部分是匿名用户的定义其实也很简单。

------------------------------------------------

启动不了,出现如下错误的解决方法

[[email protected] sbin]#
./proftpd
 - IPv4
getaddrinfo ‘new-host‘ error: Name or service not
known
 - warning:
unable to determine IP address of ‘new-host‘
 - error: no
valid servers configured
 - Fatal: error
processing configuration file
‘/usr/local/proftpd/etc/proftpd.conf‘

原因是无法绑定Ip地址。

在配置文件中增加下面这句:

DefaultAddress                 192.168.8.105
再重启服务就可以了!

对出现的530
Login incorrect错误,查看日志发现Invalid shell错误
在配置中添加

RequireValidShell             off 

"Fatal: Socket operation on non-socket"
  这通常意味着在 proftpd.conf 配置文件中 ServerType 指令被配置成 inetd
  (超级服务器)方式而不是 standalone(独立服务器) 方式来运行。

PROFTPD服务器相关命令

  1、ftpshut:关闭FTP服务,并在/etc下生成文件shutmsg。要重新开放FTP服务,把/etc/shutmsg删除。
  2、ftpcout:FTP服务器在线人数信息显示。
  3、ftpwho:FTP服务器在线人员名单。

几个文件的功能及路径
/usr/local/sbin/proftpd 执行程序
/usr/local/etc/proftpd.conf 设置文件
/usr/local/var/proftpd.pid proftpd做为一个服务的ID号

设定proftpd.conf文件,起动服务

cd /etc/rc.d/rc3.d
ln -s /usr/local/sbin/proftpd S99proftpd

或者
修改/etc/rc.d/rc.local
加上下面这句
/usr/local/sbin/proftpd start

proftpd 怎么查看在线连接的ip

登陆服务器
输入 ftpwho
或ftptop
ftptop可以显示在线人的ip 速度等

//////////////////////////////////////////////////////

ProFTPD configuration

先建立ftp和media用户,用户组为nogroup,不允许登录系统

useradd media -d/home/media -gnogroup

增加权限

chown -R media /hoem/media

要使ftp用户登录要修改/etc/ftpuser文件注释掉ftp

内网架设FTP服务器的方法:
1. 在proftpd.conf中利用MasqueradeAddress命令将网关的IP地址或域名指定给FTP服务器,例如
MasqueradeAddress
myftpserver.vicp.net   ?????
或MasqueradeAddress
12.34.56.78          ?????经使用只能连接不能下载
然后通过PassivePorts命令来限制被动方式下监听的端口的范围,例如
PassivePorts 60000 65534
2.
在网关的端口映射上将第一步中指定的端口范围(例中为60000-65534)以及FTP端口21映射到FTP服务器的内网地址上。

getaddrinfo ‘test‘ error: Name or service not
known

- warning: unable to determine IP address of ‘test‘
- error: no valid servers configured
- Fatal: error processing configuration file
‘/etc/proftpd.conf‘
解决:产生该问题是由于hosts文件里机器名未增加别名引起的。
#vi /etc/host

proftpd登陆速度慢的问题的解决

proftpd.conf中增加两行设置:
UseReverseDNS off
IdentLookups off

# This is a basic ProFTPD configuration file.
# It establishes a single server and a single anonymous
login.
# It assumes that you have a user/group "nobody" and "ftp"
# for normal/anonymous operation.

ServerName   "ProFTPD
Default Installation"
ServerType   standalone
#ServerType   inetd
DefaultServer   on

UseReverseDNS off
IdentLookups off

# Port 21 is the standard FTP port.
Port    21
# 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 that the server normally runs at.
User  ftp
# nobody
Group  nogroup
# nogroup
# This next option is required for NIS or NIS+ to work
properly:
#PersistentPasswd off

SystemLog   /var/log/proftpd.log
TransferLog   /var/log/xferlog

DefaultAddress  192.168.1.254
# Normally, we want files to be overwriteable.
<Directory /*>
  AllowOverwrite  on
</Directory>

<Anonymous ~media>
  RequireValidShell  off
  User   media 
  Group         nogroup 
  MaxClients   50
  DisplayLogin   welcome.msg
  DisplayFirstChdir  .message
<Directory /*>
  <Limit
All>
    AllowAll
  </Limit>
</Directory>
</Anonymous>
# A basic anonymous FTP server configuration.
# To enable this, remove the user ftp from /etc/ftpusers.
<Anonymous ~ftp>
  RequireValidShell  off
  User   ftp
  Group         nogroup 
  # 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
  DisplayFirstChdir  .message

# An upload directory
that allows storing files but not retrieving
  # or creating
directories.
  <Directory
/*>
    <Limit
READ>
      AllowAll
    </Limit>

# Limit WRITE everywhere
in the anonymous chroot
  <Limit
WRITE>
  AllowAll
  </Limit>
    <Limit
STOR>
      AllowAll
    </Limit>
  </Directory>

</Anonymous>

爱慕尔商城服装搭配
城市物语 
穿衣搭配博客

服装搭配博客

时间: 2024-08-25 15:44:15

proftpd的搭建以及相关配置的相关文章

Linux下nagios的搭建及相关配置

一.LAMP环境部署 1.安装php 1.安装yum源 rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm 2.执行yum安装 yum --enablerepo=remi,remi-php55 install php php-devel

Maven学习二:使用Nexus搭建Maven私服及相关配置

处于安全等原因的考虑,一些企业内部网络是不允许访问外部网络的,但是项目内部搭建的项目又是Maven架构,这样就需要企业在内部网络中搭建自己的Maven仓库服务,再者一些大型企业或者内部模块化组件化划分的比较清楚的企业开发的一些独立组件就需要使用Maven自建仓库来存放独立组件了. 使用Nexus搭建Maven私服主要有一下步骤: 1.首先需要准备好Java环境和Maven环境环境 2.到Nexus官方网站下载最新版本的Nexus https://www.sonatype.com/download

一起学ASP.NET Core 2.0学习笔记(二): ef core2.0 及mysql provider 、Fluent API相关配置及迁移

不得不说微软的技术迭代还是很快的,上了微软的船就得跟着她走下去,前文一起学ASP.NET Core 2.0学习笔记(一): CentOS下 .net core2 sdk nginx.supervisor.mysql环境搭建搭建好了.net core linux的相关环境,今天就来说说ef core相关的配置及迁移: 简介: Entity Framework(以下简称EF) 是微软以 ADO.NET 为基础所发展出来的对象关系对应 (O/R Mapping) 解决方案,EF Core是Entity

struts2.3.24 + spring4.1.6 + hibernate4.3.11 + mysql5.5.25开发环境搭建及相关说明

一.目标 1.搭建传统的ssh开发环境,并成功运行(插入.查询) 2.了解c3p0连接池相关配置 3.了解验证hibernate的二级缓存,并验证 4.了解spring事物配置,并验证 5.了解spring的IOC(依赖注入),将struts2的action对象(bean)交给spring管理,自定义bean等...并验证 6.了解spring aop(面向切面编程),并编写自定义切面函数,验证结果 二.前期准备 开发环境:eclipse for java ee:mysql5.5.25:jdk1

Linux - CentOS6.5服务器搭建与初始化配置详解(下)

传送带:Linux - CentOS6.5服务器搭建与初始化配置详解(上) 继续接着上面的安装,安装完后会出现下面界面 点击reboot重启 重启后可以看到下面的tty终端界面  因为这就是最小化安装 输入root和之前配置的密码 第一步先把防火墙给光了 iptables -F  命令用于清空规则 这里插一条命令(这个命令我忘记打上去了) /etc/init.d/iptables save  用于保存当前被清空的规则 chkconfig  iptables  stop  开机不允许启动防火墙 c

Hbase集群搭建及所有配置调优参数整理及API代码运行

最近为了方便开发,在自己的虚拟机上搭建了三节点的Hadoop集群与Hbase集群,hadoop集群的搭建与zookeeper集群这里就不再详细说明,原来的笔记中记录过.这里将hbase配置参数进行相应整理,方便日后使用. 首先vi ~/.bash_profile将hbase的环境变量进行配置,最后source ~./bash_profile使之立即生效 1.修改hbase-env.sh 由于我使用的是外置的zookeeper,所以这里HBASE_MANAGES_ZK设置为,设置参数: # The

一、记一次失败的 CAS 搭建 之 环境配置

========================================================================================================= Setp1:安装JDK.Tomcat.以及相关关联::参考:http://jingyan.baidu.com/article/8065f87fcc0f182330249841.html ===================================================

spring mvc4.1.6 + spring4.1.6 + hibernate4.3.11 + mysql5.5.25 开发环境搭建及相关说明

一.准备工作 开始之前,先参考上一篇: struts2.3.24 + spring4.1.6 + hibernate4.3.11 + mysql5.5.25 开发环境搭建及相关说明 思路都是一样的,只不过把struts2替换成了spring mvc 二.不同的地方 工程目录及jar包: action包改成controller: 删除struts2 jar包,添加spring mvc包(已有的话,不需添加):     web.xml配置: 跟之前不同的地方是把struts2的过滤器替换成了一个se

使用VMware安装linux虚拟机以及相关配置

前言 使用VMware安装虚拟机这个一般都知道,操作简单.而本文主要讲使用虚拟机的后续相关配置.并记录使用过程中遇到的问题以及一些技巧.本篇文章以后回持续更新的... 安装包准备 VM:12 Linux:CentOS 7.0 百度云盘: 链接:https://pan.baidu.com/s/1geEAtpx 密码:r503 一.CentOS 使用 1,安装CentOS 下载VMware Workstation Pro 和CentOS 系统. 成功安装之虚拟机软件后,点击新建虚拟机,安装已经下载好