
This assumes that PureFTPd has been configured to use the PureDB backend.
The useradd command can be used to create a users account.
useradd --home-dir /home/john.doe --shell /bin/bash john.doe
The passwd command can be used to give the user a password.
passwd john.doe
The id command can be used to get the users ID (uid) and group ID (gid).
~]# id john.doe
uid=1001(john.doe) gid=1001(john.doe) groups=1001(john.doe)
The mkdir (make directory), chown (change owner) and chgrp (change group) commands can be used to create a directory for the user.
mkdir /opt/pureftpd/john.doe
chown john.doe /opt/pureftpd/john.doe
chgrp john.doe /opt/pureftpd/john.doe
The pure-pw useradd command can then be used to add the user to Pure-FTPd. In this example, 1001 is the users ID (uid) and 1001 is the users group ID (gid).
pure-pw useradd john.doe -u 1001 -g 1001 -d /opt/pureftpd/john.doe
The pure-pw list command should now show that john.doe user account exists.
~]# pure-pw list
john.doe /opt/pureftpd/john.doe/./
And the /etc/pure-ftpd/pureftpd.passwd file should contain something like this.
john.doe:$2a$10$mvl8zV/6Y2I8wmRkMw36Fu8gOIVUSfvTuCWJjWyDMcf/hIMkwRaTu:1001:1001::/opt/pureftpd/john.doe/./::::::::::::
And use the pure-pw mkdb command to update the PureDB backend, making the new user account accessible.
pure-pw mkdb -f /etc/pure-ftpd/pureftpd.passwd -F /etc/pure-ftpd/pureftpd.pdb
Did you find this article helpful?
If so, consider buying me a coffee over at