|
Page Created :
FTPSERVER :
Managing users
Managing users has been created by Niklas Gustavsson (Nov 26, 2008). Content:Since FtpServer user manager might encrypt user passwords before saving them, manually administering the user database can be hard. There is basically three ways: ManuallyUsing either the PropertiesUserManager or DbUserManager you can access the data store (file or database) directly to edit users. For clear text passwords you can simply edit them. For MD5 hashed passwords, you can you use any of the available MD5 tools, for example http://www.iwebtool.com/md5 Using the APIUsing the FtpServer API, you can create a user manager, configure it as your real user manager and use that to edit users. This is a simple example: PropertiesUserManagerFactory userManagerFactory = new PropertiesUserManagerFactory();
userManagerFactory.setFile(new File("myusers.properties"));
userManagerFactory.setPasswordEncryptor(new SaltedPasswordEncryptor());
UserManager um = userManagerFactory.createUserManager();
BaseUser user = new BaseUser();
user.setName("myNewUser");
user.setPassword("secret");
user.setHomeDirectory("ftproot");
um.save(user);
|
Unsubscribe or edit your notifications preferences
