Ftp – How to change a pure-ftpd virtual-users username/login

ftppureftpd

I have pure-ftpd running on my server and I want to change just the username for some of my virtual-users. Is this possible?

I've looked in the documentation and the man page for pure-pw and it doesn't seem to be mentioned. I also tried Google but nothing came up that was related.

If so will the passwords and other settings remain the same? Or do I need to set those up again?

Best Answer

I ended up working this out myself and thought I'd share the steps below...


If you're using the pureftp.passwd file to manage your virtual-users then follow these steps:

  1. Backup pureftp.passwd first before making any changes. Mine was in /etc/pure-ftpd/.

    $ cd /etc/pure-ftpd/
    $ cp pureftp.passwd pureftp_backup.passwd

  2. Open the pureftp.passwd file with your favourite editor e.g. nano or vi.

    $ nano pureftp.passwd

    The beginning should be similar to this:

    username1:@!#*HKnkasd ...
    username2:G(*asHJKY#$ ...

  3. Edit the usernames and save the file.

  4. Next you need to rebuild the pure-ftpd user database:

    $ pure-pw mkdb

  5. Test the changes.

NOTE: Note you might need to prepend 'sudo' to the commands depending on your user access. Also you do not type the '$' sign in the above commands. It's purely indicative of your shell prompt.