Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7870857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:44:07+00:00 2026-06-03T01:44:07+00:00

I am trying to set up a ftp server using apache ftp server http://mina.apache.org/ftpserver/

  • 0

I am trying to set up a ftp server using apache ftp server
http://mina.apache.org/ftpserver/

I want to use a file based management, and have only one user that can login.
At first, I create the file this way :

String username = "ftp";
String password = "ftp";
String ftproot = "data";        

// prepares the user manager
PropertiesUserManagerFactory userManagerFactory = new PropertiesUserManagerFactory();
userManagerFactory.setFile(new File(propFile));
userManagerFactory.setPasswordEncryptor(new SaltedPasswordEncryptor());
UserManager um = userManagerFactory.createUserManager();
// set up my user
BaseUser user = new BaseUser();
user.setName(username);
user.setPassword(password);
user.setHomeDirectory(ftproot);
List<Authority> authorities = new ArrayList<Authority>();
authorities.add(new WritePermission());        
user.setAuthorities(authorities);

um.save(user);
// adds the user
serverFactory.setUserManager(um);

The file seems ok, and the ftp server works fine if I go through these steps at each startup.

What I would like is to be able to set this file once, and then just load the property file so that the user/password can be removed from the code.

I try for some time but can’t get anything this way to run.

Any help would be greatly appreciated.
Thank you by advance !

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T01:44:09+00:00Added an answer on June 3, 2026 at 1:44 am

    Ok, once again the “tell it to your teddy bear” method worked just fine.

    I found the solution two minutes after posting.

    Instead of going through the all configuration dance, one just need to set the user manager.

    userManagerFactory.setFile(new File(propFile));
    userManagerFactory.setPasswordEncryptor(new SaltedPasswordEncryptor());
    UserManager um = userManagerFactory.createUserManager();
    serverFactory.setUserManager(um);
    

    Here is my whole load the config method.

    Hope this will help someone.

    I think the apache ftp server would really need some more documentation though :S.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I trying to get a file from an FTP server using ftp_get from PHP
I'm trying to connect to a FTP AS/400 server using .NET, with a url
I'm trying to access an FTP server from my PHP script using Codeigniter's FTP
I am trying to download file using FTP, and in between if connection terminates
Trying to set up caching on our datasets - we're using clr stored procedures
I'm trying to connect to my server using php script to upload some files...
I am transferring a binary file (.exe) with FTP using libcurl, and saving it
I'm trying to download files in subdirectories from an ftp server with ant. The
I’m trying to set-up Magento on my server, but I still haven’t succeeded in
I'm trying to specify the passive port range for an ftp server running on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.