I'm getting a constant "connection refused" while trying to connect over SSH from OS X to a CentOS VPS with a WHM control panel. SSH is enabled in WHM, and I've generated SSH keys. I also tried SSH with the firewall off for a minute , but no luck.
After perusing other questions, I've run ssh -vv [email protected]
and that gives me:
debug2: ssh_connect: needpriv 0
debug1: connect to address xx.xxx.xx.xx port 22: Connection refused
and running nc -zvw 2 xx.xxx.xx.xx 22
gives me
nc: connect to xx.xxx.xx.xx port 22 (tcp) failed: Connection refused
What do these really mean? What else can I try?
The port appears to be closed (or filtered, but you say you've already tried disabling the firewall - you mean the one on the VPS, right?).
Can you please post the output of this command on the VPS if you have access by other means?
It should list all open ports. Check port 22 is up on the right IP if you have several.
Do you have outgoing traffic firewall rules on the OSX client?
Edit: I took the liberty of running a port scan against that host and it doesn't seem to have a firewall up anyway, as many ports are open (you should probably close some or most when you can). SSH doesn't seem to be up though:
Try
/etc/init.d/sshd restart
and check/var/log/messages
for errors.If you are getting "Permission denied", make sure that:
1 - Your key is on .ssh/authorized_keys
2 - The permissions on .ssh/authorized_keys are right. Do a
chmod -R 700 .ssh
to be sure.have you checked
/etc/hosts.deny
? I once had thedenyhosts
daemon running by mistake and kept adding my laptop there, until I found and killed it.is quite a simple fix and can be completed in a few minutes via the standard cPanel /scripts
This will fix your problems some of the time, but if it does not, do the following steps:
If you are still having issues, try checking out the cpanel forums, or contact cpanel support for more help.