Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.0-M3
    • Fix Version/s: 1.0.0-M4
    • Component/s: None
    • Labels:
      None

      Description

      There is no mention in the docs of how to manage users (i.e. add new ones, etc.). There's one page which mentions the admin GUI app which is not available in the distribution (see issue FTPSERVER-201). As a new user on a new installation, I could not find the mechanism by which I can add and administer users on the server, which makes it pretty much unusable.

        Activity

        Hide
        Niklas Gustavsson added a comment -

        Command line tool for managing users added as well as documentation on some approaches. Hopefully that should solve the basics. The cli tool will need further work, but should be sufficient for 1.0

        Show
        Niklas Gustavsson added a comment - Command line tool for managing users added as well as documentation on some approaches. Hopefully that should solve the basics. The cli tool will need further work, but should be sufficient for 1.0
        Hide
        Gary Bell added a comment -

        Ok, FTPSERVER-218 added a refresh() method to the PropertiesUserManager, so now you can use that.

        https://issues.apache.org/jira/browse/FTPSERVER-218

        === Snippet from onSite() method call ===
        String cmd = request.getArgument().toUpperCase();
        if ("UPDATE ACCTS".equals(cmd)) {
        // admin has hand-edited the user file and wants to let the server know...

        ((PropertiesUserManager) server.getUserManager()).refresh(); //server is an instance of DefaultFtpServer created earlier..
        return FtpletResult.SKIP; // prevent further processing.
        =====================================

        Show
        Gary Bell added a comment - Ok, FTPSERVER-218 added a refresh() method to the PropertiesUserManager, so now you can use that. https://issues.apache.org/jira/browse/FTPSERVER-218 === Snippet from onSite() method call === String cmd = request.getArgument().toUpperCase(); if ("UPDATE ACCTS".equals(cmd)) { // admin has hand-edited the user file and wants to let the server know... ((PropertiesUserManager) server.getUserManager()).refresh(); //server is an instance of DefaultFtpServer created earlier.. return FtpletResult.SKIP; // prevent further processing. =====================================
        Hide
        Gary Bell added a comment -

        D'oh! My suggestion above will not work after FTPServer-187. The change to immutable classes means that you cannot set a different UserManager once the listener is created.

        Show
        Gary Bell added a comment - D'oh! My suggestion above will not work after FTPServer-187. The change to immutable classes means that you cannot set a different UserManager once the listener is created.
        Hide
        Gary Bell added a comment -

        You can manually edit the user properties file, using the MD5 encrypt webpage at http://www.iwebtool.com/md5 to create the password hash. You have to restart the server to get it to see the change though. We have implemented a custom SITE UPDATE command to create a new UserManager object and call the setUserManager() on the default listener:

        FtpServer server = new FtpServer();
        String filename = "c:\bar\foo.properties"; //name of user property file.

        ....
        ....

        === Snippet from onSite() method call ===
        PropertiesUserManager userManager = new PropertiesUserManager();
        userManager.setFile(new File(filename)); //re-read the properties file with the newly added accounts.
        userManager.configure();
        server.getListener("default").setUserManager(userManager);
        ==================================

        This seems to work OK for us.

        Show
        Gary Bell added a comment - You can manually edit the user properties file, using the MD5 encrypt webpage at http://www.iwebtool.com/md5 to create the password hash. You have to restart the server to get it to see the change though. We have implemented a custom SITE UPDATE command to create a new UserManager object and call the setUserManager() on the default listener: FtpServer server = new FtpServer(); String filename = "c:\bar\foo.properties"; //name of user property file. .... .... === Snippet from onSite() method call === PropertiesUserManager userManager = new PropertiesUserManager(); userManager.setFile(new File(filename)); //re-read the properties file with the newly added accounts. userManager.configure(); server.getListener("default").setUserManager(userManager); ================================== This seems to work OK for us.

          People

          • Assignee:
            Niklas Gustavsson
            Reporter:
            Amichai Rothman
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development