Apache FtpServer is an open source FTP server written in pure Java .
Download addresshttp: //mina.apache.org/ftpserver/
Here we will not talk about the development of FTPServer , mainly to briefly understand how to build FTP .
1. Download Apache FtpServer 1.0.5 Release
http://mina.apache.org/ftpserver/downloads.html
2. Unzip to local
3. Modify the file F:/FTP/ftpserver-1.0.5/apache-ftpserver-1.0.5/res/conf/users.properties
Modified as follows:
# 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.
ftpserver.user.admin.userpassword=admin
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/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
4. 修改F:/FTP/ftpserver-1.0.5/apache-ftpserver-1.0.5/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">
<listeners>
<nio-listener name="default" port="21">
<ssl>
<keystore file="./res/ftpserver.jks" password="password" />
</ssl>
</nio-listener>
</listeners>
<file-user-manager file="./res/conf/users.properties" encrypt-passwords = "clear"/>
</server>
Remember to add <file-user-manager file="./res/conf/users.properties" encrypt-passwords = "clear"/> here
Change the password encryption method to clear
5. Install FTPServer
Enter the CMD command F:/FTP/ftpserver-1.0.5/apache-ftpserver-1.0.5/bin and execute it in the directory
service install Enter
ftpd.bat res/conf/ftpd-typical.xml Enter
Screenshot below:
6. Test the connection to FTP , the port here is the default 21 , which has been modified in the configuration earlier.