I was having an issue with all users accessing their ftp accounts on my cpanel web server. It had worked previously however it seemed to change suddenly, preventing users accessing their files. This also prevented the root user accessing the server via ftp.
When trying to connect using filezilla, I was getting connected to the web server however the directories were not listing, I was getting the following error: ‘ the data connection could not be established: ECONNREFUSED – Connection refused by server ‘. I could see I was establishing a connection to the web server because I could see the user listed under FTP Connections in the clients cPanel control panel.
To fix the issue with listing the directory with my FTP client I connected to my web server via ssh and logged in as the sudo user, I used the root account. Once logged in I ran the following command: ‘ /sbin/iptables -F ‘,This command flushes the iptables on the server.
Once the command was run I was able to connect once again to the server via FTP.