FTP -- 使用Apache FtpServer搭建FTP服务器

参考资料:http://wangcheng.iteye.com/blog/364756

下载linux版本
http://apache.fayea.com/mina/ftpserver/1.0.6/dist/ftpserver-1.0.6.tar.gz

解压缩到本地

在安装目录的res\conf目录中找到users.properties,复制一份为myusers.properties,修改成自己的用户名

# Password is "admin"
ftpserver.user.admin.userpassword=adminadmin
#ftpserver.user.admin.homedirectory=/var/www/pic
ftpserver.user.admin.homedirectory=/data/pbs/pic
ftpserver.user.admin.enableflag=true
ftpserver.user.admin.writepermission=true
ftpserver.user.admin.maxloginnumber=1000
ftpserver.user.admin.maxloginperip=10
ftpserver.user.admin.idletime=0
ftpserver.user.admin.uploadrate=0
ftpserver.user.admin.downloadrate=0

在res\conf目录中找到ftpd-typical.xml文件,复制一份,改名为 my-ftpd-typical.xml

<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="2000" anon-enabled="false" max-anon-logins="0" max-login-failures="3" login-failure-delay="30000">
    <listeners>
        <nio-listener name="default" port="21">
            <ssl>
                <keystore file="./res/ftpserver.jks" password="password" />
            </ssl>
        <data-connection idle-timeout="60">
                <active enabled="true" ip-check="true" />
                <passive ports="2010-2012"/>
        <!-- <passive ports="0"/> -->
            </data-connection>
            </nio-listener>
    </listeners>
    <file-user-manager file="./res/conf/users.properties" encrypt-passwords="clear"/>
</server>

启动FTP,nohup /usr/local/Apache_FtpServer/bin/ftpd.sh res/conf/myftpd-typical.xml> /dev/null 2>1 &

你可能感兴趣的:(服务器,ftp)