1

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?

2 Answers 2

4

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.

0

For me work it:

1) Install pure-ftpd

sudo apt-get install pure-ftpd

2) Add group for virtual users

sudo groupadd ftpgroup

3) Add ftp user for virtual user

sudo useradd -g ftpgroup -d /dev/null -s /etc

4) Enable ChrootEveryone option

sudo echo on > /etc/pure-ftpd/conf/ChrootEveryone

5) Enable the virtual user authentication

sudo ln -s /etc/pure-ftpd/conf/PureDB /etc/pure-ftpd/auth/40PureDB

6) And restart pure-ftpd

sudo /etc/init.d/pure-ftpd restart

7) Create the user dir

mkdir /home/ftp/joe

8) Change the owner/group to the ftp user

sudo chown ftpuser:ftpgroup /home/ftp/joe

9) Create user joe with home directory /home/ftp/joe

pure-pw useradd joe -u ftpuser -d /home/ftp/joe

10) Write changes to the database

pure-pw mkdb

UPDATE:

How to change an existing pure-ftpd Virtual username:

1) Go to password file (in my case - ubuntu server):

sudo nano /etc/pure-ftpd/pureftpd.passwd

2) Change the user name for example:

An existing (user name josecarlosold):

josecarlosold:$1$ITkf2XA0$imFzCWux1rsnPieBlEttQ0:1001:1001::/home/josecarlos/./::::::::::::

NEW (user name josecarlosnew):

josecarlosnew:$1$ITkf2XA0$imFzCWux1rsnPieBlEttQ0:1001:1001::/home/josecarlos/./::::::::::::

3) Re-make the pure-ftpd DB:

sudo pure-pw mkdb

4) Open your ftp client and try connect with the new username josecarlosnew and the same password that josecarlosold. Remember josecarlosold and josecarlosnew are user to explant.

Reference

2
  • This doesn't explain how to change an existing pureftp users username.
    – Ben
    Feb 28, 2017 at 22:35
  • Opss, Sorry, I update right now. Mar 1, 2017 at 13:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .