If you still get access denied from slave servers with the correct users, the settings for those users are wrong in the database. Or those hosts are denied to connect in firewall or database settings. Check if you can connect to database with any user for all slaves. Check also /etc/hosts file is correct in all hosts, i.e. it has all hosts of your setup with the right IP-numbers on the master and all slaves.
Since I can log from the slave to the master with its public IP, the credentials are good. On both servers, netstat -lnt | grep 3306 gives me Code: tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN But I got iptables on my master server. Anyway, I replaced the private IP of the /usr/local/ispconfig/server/lib/config.inc.php from the slave with the public IP of the master.
Thanks for the help, guys. Even if I couldn't use the private IP, I managed to use the public IP. I don't know what this method is riskier than the other but well, it works.