Create an FTP user on a cPanel server from backend (shell)

May 29, 2010 by: Akhthar Parvez

Ever wondered how to create FTP users on a cPanel server? Adding FTP using pure-pw (for Pure-ftpd, who uses proftpd anyway?) won’t work because cPanel will overwrite it when you run /usr/local/cpanel/bin/ftpupdate. FYI, that command is being run everytime you add a new account on the server.

Here’s the command to create an FTP user on a cPanel server:

/usr/local/cpanel/bin/proftpd_passwd abc -a abc_ftp:test:501:501:abc:/home/abc/public_html/test:/sbin/nologin

where abc_ftp@<domainname> is the virtual FTP user and abc is the system user to which the FTP user belongs to.

Done, it’s that simple 🙂

Thinking if the above command was meant for adding a ProFTP user? Well, it’s for adding an FTP user on cPanel servers no matter which FTP server you’re on. cPanel stores the passwd in /etc/proftpd/<user> file (and a combined list in /etc/proftpd/passwd.vhosts), whether its’ Pro or Pure.

Here’s the syntax:

/usr/local/cpanel/bin/proftpd_passwd <sys user> -a <vuser>:<passwd>:<uid>:<gid>:<owner>:<home_dir>:<shell>

You may delete the FTP user as below:

/usr/local/cpanel/bin/proftpd_passwd <sys user> -d <vuser>

If you ever edit the passwd files directly to remove a user, you should run the following command so that the changes can take effect:

/usr/local/cpanel/bin/ftpupdate

Filed under: cPanel
Tags: , , , , , , , ,

Leave a Reply

You must be logged in to post a comment.