使用嵌入式Apache FTP服务器验证失败(错误530)
我在我的java web应用中嵌入apache ftpserver,我尝试了几个不同的东西,每次尝试通过FTP连接到服务器时,它都表示验证失败。当我尝试登录时,我附加了我的代码和控制台输出。有没有人有任何建议?我试着在OS X和Centos Linux上运行它。使用嵌入式Apache FTP服务器验证失败(错误530)
PropertiesUserManagerFactory userManagerFactory = new PropertiesUserManagerFactory(); userManagerFactory.setFile(new File("/ftpdata/myusers.properties"));
//userManagerFactory.setPasswordEncryptor(new SaltedPasswordEncryptor());
userManagerFactory.setPasswordEncryptor(new ClearTextPasswordEncryptor());
UserManager um = userManagerFactory.createUserManager();
BaseUser user = new BaseUser();
user.setName("andy");
user.setPassword("12345678");
user.setHomeDirectory("/ftpdata/");
um.save(user);
FtpServerFactory serverFactory = new FtpServerFactory();
ListenerFactory factory = new ListenerFactory();
factory.setPort(2225);
serverFactory.addListener("default", factory.createListener());
FtpServer server = serverFactory.createServer();
server.start();
12:03:28,768 INFO [STDOUT] 12:03:28,768 INFO [DefaultFtpServer] FTP server started
12:04:14,200 INFO [STDOUT] 12:04:14,200 INFO [FtpLoggingFilter] CREATED
12:04:14,208 INFO [STDOUT] 12:04:14,208 INFO [FtpLoggingFilter] OPENED
12:04:14,228 INFO [STDOUT] 12:04:14,228 INFO [FtpLoggingFilter] RECEIVED: USER andy
12:04:14,230 INFO [STDOUT] 12:04:14,230 INFO [FtpLoggingFilter] SENT: 220 Service ready for new user.
12:04:14,232 INFO [STDOUT] 12:04:14,232 INFO [FtpLoggingFilter] SENT: 331 User name okay, need password for andy.
12:04:14,233 INFO [STDOUT] 12:04:14,233 INFO [FtpLoggingFilter] RECEIVED: PASS *****
12:04:14,236 INFO [STDOUT] 12:04:14,236 WARN [PASS] User failed to log in
12:04:14,736 INFO [STDOUT] 12:04:14,736 WARN [PASS] Login failure - andy
12:04:14,740 INFO [STDOUT] 12:04:14,740 INFO [FtpLoggingFilter] RECEIVED: QUIT
12:04:14,746 INFO [STDOUT] 12:04:14,746 INFO [FtpLoggingFilter] SENT: 530 Authentication failed.
12:04:14,746 INFO [STDOUT] 12:04:14,746 INFO [FtpLoggingFilter] SENT: 221 Goodbye.
12:04:14,747 INFO [STDOUT] 12:04:14,746 INFO [FtpLoggingFilter] CLOSED
回答:
我的问题可能听起来很蠢,但 我可以将日志
12所示:04:14233 INFO [STDOUT] 12:04:14233 INFO [FtpLoggingFilter] RECEIVED:PASS *****
这些都是5星,您的密码长度为8:d
我可以看到你传递一个属性文件,是有你在那里有密码的任何机会呢?
最后,你创建一个UserManager,你不必在某个地方传递这个对象?
以上是 使用嵌入式Apache FTP服务器验证失败(错误530) 的全部内容, 来源链接: utcz.com/qa/259064.html