How can I add a user to Pure-FTPd using the command line in CentOS 7?

How can I add a new user to Pure-FTPd on a CentOS 7 server using the command line? I have tried the standard process of adding a user with the ‘pure-pw useradd’ command, but I keep getting an error message saying “You must give (non-root) uid and gid”. Is there something specific I need to do to create a user in Pure-FTPd on CentOS 7?

To add user in Pure-FTPd using SSH, you can use the following steps:

  1. Connect to your server via SSH.
  2. Run the pure-pw command to create a new user.
pure-pw useradd john -u ftpuser -d /home/ftpuser
  1. Run the ‘pure-pw mkdb’ command to create the necessary database files for Pure-FTPd to recognize the new user.
pure-pw mkdb
  1. Restart the Pure-FTPd service.
systemctl restart pure-ftpd

ftpuser user is an existing system user. You need to specify the system username with the -u flag. This will create a new user named john with the system username ftpuser and the home directory /home/ftpuser.