服务器搭建
1.下载资源 ftpserver-1.0.6.tar.gz
2. tar -xzvf ftpserver-1.0.6.tar.gz 解压
3.修改两个配置文件
apache-ftpserver-1.0.6/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.
# 此处cmsftp为 ftp登录用户名
ftpserver.user.admin.userpassword=admin123
ftpserver.user.admin.homedirectory=../dir
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/home
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
apache-ftpserver-1.0.6/res/conf/ftpd-typical.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<server xmlns="http://mina.apache.org/ftpserver/spring/v1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://mina.apache.org/ftpserver/spring/v1 http://mina.apache.org/ftpserver/ftpserver-1.0.xsd
"
id="myServer"
max-logins="50"
anon-enabled="false"
max-anon-logins="0"
max-login-failures="3"
login-failure-delay="30000">
<listeners>
<!--ftp端口配置-->
<nio-listener name="default" port="9921">
<ssl>
<keystore file="./res/ftpserver.jks" password="password" />
</ssl>
<!--考虑到服务器的安全性,此处采用了 “被动模式”-->
<data-connection idle-timeout="60">
<active local-port="9922" />
<passive ports="9922" />
</data-connection>
</nio-listener>
</listeners>
<file-user-manager file="./res/conf/users.properties" encrypt-passwords="clear"/>
</server>
4.启动
在apache-ftpserver-1.0.6目录下 使用
sh bin/ftpd.sh /res/conf/ftpd-typical.xml (此处需指定ftpd-typical.xml 作为参数文件传入)
这种启动方式,当退出时服务就会被断掉。我们可以在后台启动
nohup sh apache-ftpserver-1.0.6/bin/ftpd.sh /res/conf/ftpd-typical.xml > ftplog/`date '+%Y%m%d'`ftp.log > /dev/null 2>&1 &
客户端工具配置
这里使用 filezilla.exe
1.配置服务器连接
2.传送设置
3.字符集
4.连接成功