If you are unable to connect to a cpanel server via ssh using port 22, resetting the ssh configuration port to alternate one will fix the issue.
For doing that, login to your whm on non secure port (2086) and use below url to reset ssh configuration port
http://YOUR-IP-HERE:2086/cpsess12345678/scripts2/doautofixer?autofix=safesshrestart
That will configure sshd to run on port 23 and will show below result:
You can refresh page to restart SSH on port 22.