zoukankan      html  css  js  c++  java
  • Apache ftpServer 配置用户

    Apache ftpServer 配置用户

    问题

    Apache ftpServer默认配置文件中,使用./res/conf/users.properties配置用户信息。

    <file-user-manager file="./res/conf/users.properties" />
    

    默认有2个用户:管理员admin和匿名用户anonymous。

    # 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.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/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
    
    

    尝试在该文件继续添加自定义用户。

    ftpserver.user.myuser.userpassword=myuser
    ftpserver.user.myuser.homedirectory=./res/home
    ftpserver.user.myuser.enableflag=true
    ftpserver.user.myuser.writepermission=true
    ftpserver.user.myuser.maxloginnumber=0
    ftpserver.user.myuser.maxloginperip=0
    ftpserver.user.myuser.idletime=0
    ftpserver.user.myuser.uploadrate=0
    ftpserver.user.myuser.downloadrate=0
    

    发现客户端无法连接。提示:

    状态:	正在连接 127.0.0.1:21...
    状态:	连接建立,等待欢迎消息...
    响应:	220 Service ready for new user.
    命令:	USER myuser
    响应:	331 User name okay, need password for myuser.
    命令:	PASS ******
    响应:	530 Authentication failed.
    错误:	严重错误
    错误:	无法连接到服务器
    

    看提示应该是密码不对。但是密码确实是我配置的。

    解决方案

    在ftpd.xml中配置的<file-user-manager file="./res/conf/users.properties" />加上encrypt-passwords="clear"

    <file-user-manager file="./res/conf/users.properties"  encrypt-passwords="clear"/>
    

    参考:
    Apache FtpServer 添加用户实现

  • 相关阅读:
    【转】Android之四大组件、六大布局、五大存储
    Android O 8.0 奥利奥
    安卓7.1新特性
    那些年我们踩过的坑,SQL 中的空值陷阱!
    8年经验面试官详解 Java 面试秘诀
    Github 第三方授权登录教程
    40个超有趣的Linux命令行彩蛋和游戏
    Synchronized锁在Spring事务管理下,为啥还线程不安全?
    Windows Server 2008 R2文件服务器升级到Windows Server 2016
    牛客练习赛61
  • 原文地址:https://www.cnblogs.com/jimmyfan/p/12505017.html
Copyright © 2011-2022 走看看