CloudPanel SSH or SFTP login fails: permission denied and connection errors
FileZilla says "Connection timed out", your terminal says "Permission denied (publickey)", or a user who logged in yesterday can't today. SSH and SFTP problems on CloudPanel come down to three things: the firewall, the user, and the login method. Here's how to work through them. For setting up users, see CloudPanel SSH, SFTP, FTP and File Manager.
The basics: which port and which user?
Error 1: "Connection timed out"
Nothing answered. Almost always a firewall.
Error 2: "Connection refused"
The server answered, but SSH isn't listening on that port. Maybe the SSH port was changed. Check and connect with .
Error 3: "Permission denied (publickey)"
The server only accepts SSH keys, and yours wasn't accepted. Some VPS providers switch off password logins by default.; the last lines show which keys were tried and why they were refused.
Error 4: "Permission denied, please try again" (password)
Wrong password, or password logins are disabled on the server. Reset the user's password in the site's SSH/FTP tab (Generate new password makes a strong one). If password logins are off for the whole server, use an SSH key instead (Error 3).
Error 5: logged in, but can't see or change files
FTP connects but the file list never loads
That's the passive port range. CloudPanel's firewall rule for FTP opens ports 20-21 and the passive range 49152-65534 for your IP. If your provider has a cloud firewall too, open the same range there. Also check the ProFTPD MasqueradeAddress setting mentioned in CloudPanel's docs if the server is behind NAT. Better still, use SFTP: one port, encrypted, fewer problems.
Sources: CloudPanel: SSH/FTP · OpenSSH: ssh manual
More CloudPanel troubleshooting
Applies to CloudPanel v2 on Ubuntu and Debian, October 2026. In the commands, replace with your domain and with your site's user name (shown on the site's Settings page).
FileZilla says "Connection timed out", your terminal says "Permission denied (publickey)", or a user who logged in yesterday can't today. SSH and SFTP problems on CloudPanel come down to three things: the firewall, the user, and the login method. Here's how to work through them. For setting up users, see CloudPanel SSH, SFTP, FTP and File Manager.
The basics: which port and which user?
- SSH and SFTP: port 22 (unless you changed it). SFTP is file transfer over SSH, so it uses the same port and users.
- FTP: port 21, plus a passive port range. FTP and SFTP are different; use the matching protocol in your client.
- Users: SSH/SFTP users are created per site in the site's SSH/FTP tab. FTP users are separate and have their own home directory.
Error 1: "Connection timed out"
Nothing answered. Almost always a firewall.
- CloudPanel's firewall (Admin Area > Security): if you limited port 22 to your IP and your IP changed, you're blocked. Ask someone with access to update the rule, or use your VPS provider's web console to log in and fix it.
- Your provider's cloud firewall, if you use one, must allow port 22 too.
- Test from your computer: Code:
nc -vz -w 5 YOUR_SERVER_IP 22
Code:
ufw status numbered
ss -tlnp | grep sshdError 2: "Connection refused"
The server answered, but SSH isn't listening on that port. Maybe the SSH port was changed. Check
Code:
grep -i '^Port' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.confCode:
ssh -p NEWPORT user@serverError 3: "Permission denied (publickey)"
The server only accepts SSH keys, and yours wasn't accepted. Some VPS providers switch off password logins by default.
- Add your public key (on your computer) to the SSH user in the site's SSH/FTP tab. Paste the whole line, starting withCode:
~/.ssh/id_ed25519.puborCode:ssh-ed25519.Code:ssh-rsa
- Tell your client which key to use: . In FileZilla, add the key under Settings > SFTP.Code:
ssh -i ~/.ssh/id_ed25519 siteuser@YOUR_SERVER_IP
- Make sure you're using the right user name. Logging in as with a site user's key (or the other way round) fails.Code:
root
Code:
ssh -v siteuser@YOUR_SERVER_IPError 4: "Permission denied, please try again" (password)
Wrong password, or password logins are disabled on the server. Reset the user's password in the site's SSH/FTP tab (Generate new password makes a strong one). If password logins are off for the whole server, use an SSH key instead (Error 3).
Error 5: logged in, but can't see or change files
- Each user only sees its own site's home folder. Files of other sites aren't visible; that's by design.
- "Permission denied" when saving: the file belongs to root. Fix ownership as root: Code:
chown -R siteuser:siteuser /home/siteuser/htdocs/example.com
FTP connects but the file list never loads
That's the passive port range. CloudPanel's firewall rule for FTP opens ports 20-21 and the passive range 49152-65534 for your IP. If your provider has a cloud firewall too, open the same range there. Also check the ProFTPD MasqueradeAddress setting mentioned in CloudPanel's docs if the server is behind NAT. Better still, use SFTP: one port, encrypted, fewer problems.
Sources: CloudPanel: SSH/FTP · OpenSSH: ssh manual
More CloudPanel troubleshooting
- Installation failed: common install errors
- Can't log in: port 8443, password and 2FA
- Site shows 403 Forbidden or 404
- Too many redirects or mixed content after SSL
- PHP extension missing / enable ionCube
- WordPress asks for FTP or can't update plugins
- Varnish showing old pages or breaking logins
- Restore a site from a backup
- Node.js app shows 502 or keeps restarting
- Site hacked: find malware and clean up
- clpctl errors: not found, wrong user, quoting
Applies to CloudPanel v2 on Ubuntu and Debian, October 2026. In the commands, replace
Code:
example.comCode:
siteuser
