CyberPanel FTP not working on Ubuntu Server
On CyberPanel server, FTP was not working. I checked the server with “netstat -lntp” command. No service was listening on port 21. Started pure-ftpd with command
systemctl start pure-ftpd-mysql
To start pure-ftpd on boot, run
systemctl enable pure-ftpd-mysql
Now FTP service started listening on port 21, but login to the FTP server failed with an error “Login authentication failed”.
pure-ftpd on CyberPanel server uses MySQL authentication. We need to configure pure-ftpd to use the “users” table in “cyberpanel” database.
Edit file
vi /etc/pure-ftpd/db/mysql.conf
In this file, you need to add MySQL login details
MYSQLUser MYSQLPassword MYSQLDatabase cyberpanel MYSQLCrypt md5
If you don’t have a MySQL user, create one with
GRANT ALL PRIVILEGES ON *.* TO 'ftpadmin'@'localhost' IDENTIFIED BY 'USER_PASSWORD_HERE' WITH GRANT OPTION; GRANT PROXY ON ''@'' TO 'ftpadmin'@'localhost' WITH GRANT OPTION;
Here is the example config
MYSQLSocket /var/run/mysqld/mysqld.sock MYSQLUser ftpadmin MYSQLPassword MYSQL_USER_PW_HERE MYSQLDatabase cyberpanel MYSQLCrypt md5 MYSQLGetPW SELECT Password FROM users WHERE User='\L' MYSQLGetUID SELECT Uid FROM users WHERE User='\L' MYSQLGetGID SELECT Gid FROM users WHERE User='\L' MYSQLGetDir SELECT Dir FROM users WHERE User='\L'
If you don’t have MySQL auth enabled, enable it with
ln -s /etc/pure-ftpd/conf/MySQLConfigFile /etc/pure-ftpd/auth/30mysql
Restart pure-ftp-mysql with
systemctl restart pure-ftpd-mysql
See CyberPanel