使用Apache FtpServer搭建FTP服务器

Apache FtpServer是纯Java写的(基于mina-http://mina.apache.org/)开源FTP服务器。 http://mina.apache.org/ftpserver/

一. 安装

 

1. 从 http://mina.apache.org/ftpserver/ 下载

  http://mina.apache.org/ftpserver/downloads.html

2. 解压缩到本地

 


二. 启动ftpserver

进入 %FtpServer_Home%/bin下 新建bun.bat,内容如下

ftpd.bat res/conf/ftpd-typical.xml

保存run.bat,然后双击运行

访问 yourip:2121

注:直接运行 ftpd.bat启动起来的ftpserver没有任何用户信息,所以是没有意义的.apache ftpserver为我们提供了两个现有的服务配置


以上我们是用它提供的一个典型的配置信息ftpd-typical.xml(在运行ftpd.bat时将res/conf/ftpd-typical.xml作为参数传入),而用户信息位于users.properties中



三. 配置用户信息

res\conf\users.properties:

# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#  http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.


# Password is "admin"
#格式 ftpserver.user.用户名.属性


#密码
ftpserver.user.admin.userpassword=21232F297A57A5A743894A0E4A801FC3
#目录
ftpserver.user.admin.homedirectory=./res/home
ftpserver.user.admin.enableflag=true
#是否可写
ftpserver.user.admin.writepermission=true
ftpserver.user.admin.maxloginnumber=0
ftpserver.user.admin.maxloginperip=0
ftpserver.user.admin.idletime=0
ftpserver.user.admin.uploadrate=0
ftpserver.user.admin.downloadrate=0


ftpserver.user.anonymous.userpassword=
ftpserver.user.anonymous.homedirectory=./res/anonymous
ftpserver.user.anonymous.enableflag=true
ftpserver.user.anonymous.writepermission=false
ftpserver.user.anonymous.maxloginnumber=20
ftpserver.user.anonymous.maxloginperip=2
ftpserver.user.anonymous.idletime=300
ftpserver.user.anonymous.uploadrate=4800
ftpserver.user.anonymous.downloadrate=4800




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值