Unable to connect to a cPanel server via SSH

glmanager

Member
Jun 14, 2022
15
0
1
Chatswood
cPanel Access Level
Reseller Owner
Hi guys,

In WHM - Service configuration - Service manager - SSH Daemon is enabled.
I checked firewall a rule that redirects incoming SSH traffic to the cPanel server.
However, from outside I'm unable to connect to the cPanel via SSH.
What else SSH-related I should check?
(I still can access the cPanel server via terminal)
 

kodeslogic

Well-Known Member
PartnerNOC
Apr 26, 2020
542
253
138
IN
cPanel Access Level
Root Administrator
Have you set up a custom SSH port?
 

rbairwell

Well-Known Member
May 28, 2022
98
42
18
Mansfield, Nottingham, UK
cPanel Access Level
Root Administrator
I assume you've restarted the SSH server after you changed sshd_config? (Was it working before the change?)

Have you tried using ssh -v [email protected]<serverip>:port to see at which stage it is failing?

[Added later]

It might be worth double checking with your hosting provider/datacentre that they allow that port through their firewalls (yes, you probably run a software firewall on the cPanel server, but there may be a hardware/software firewall "in front" of that server or VPS host and there may be one on the datacentre) - I was with a DC who offered a flexible control panel to manage the firewall "in front" of my server - only to find out later that it only allowed me to configure the IPv4 firewall and the IPv6 one was quite restricted and couldn't be changed. I had to move DCs because of that.
 
Last edited:
  • Like
Reactions: cPRex

Lolfust

Member
Jan 30, 2018
15
2
3
Tel aviv
cPanel Access Level
Root Administrator
after setting up the custom SSH port, have you reset the service of sshd?
also have you checked on CSF / Imunify360 firewall if the new custom SSH port are open for TCP traffic??

EDIT -
if you using also your hosting provider firewall, verify that the custom port is open(edit the default port number to the custom one)
 

Alan_Scott

Registered
Oct 28, 2022
3
1
3
Wolverine
cPanel Access Level
Website Owner
If you are unable to connect to your cPanel via SSH, there are a few things you can do to troubleshoot the issue. First, make sure that you are using the correct SSH credentials. If you are unsure of your SSH username or password, you can reset them in the cPanel interface.

Second, check that your SSH port is open and accessible. The default SSH port is 22, but it may be different on your server. You can check your server's SSH port by running the 'netstat -an' command.

Third, make sure that your firewall is not blocking access to the SSH port. You can do this by temporarily disabling your firewall and trying to connect again.