SSH on Different Port w/ KEY Authentication

zackrspv

Registered
Nov 22, 2011
3
0
51
cPanel Access Level
Root Administrator
Initially, I had set my SSH server to bind to a different port other than port 22. And subsequently configured the firewall, restarted CSF, etc etc. But, anytime I would try to connect using a PKA, boom, wouldn't work. But, when i ran the link above to reset SSH back to WHM defaults, boom works fine.

So, why?

Nothing has changed w/ the keys, or the key pass phrases.

It's just the port.

Are we not able to choose a different port for SSH for security purposes, so that we do not leave it open for attack?

What I want to do:
* Change SSH port to a port of my choosing.
* Login using a Key, not the actual password.

But, unless i leave it on port 22, i can't do that. For, when i change it to something else, i can't login w/ the key.
 
Last edited:

storminternet

Well-Known Member
Nov 2, 2011
460
0
66
cPanel Access Level
Root Administrator
Hi,

You can change different ssh pot with the key authentication, I don't think that there should be any problem for ssh.
I doubt that firewall is not allowing new ssh port accessible. Just telnet to your server at new ssh port and that will give you an idea if the port is opened or not behind server firewall.
 

zackrspv

Registered
Nov 22, 2011
3
0
51
cPanel Access Level
Root Administrator
Hi,

You can change different ssh pot with the key authentication, I don't think that there should be any problem for ssh.
I doubt that firewall is not allowing new ssh port accessible. Just telnet to your server at new ssh port and that will give you an idea if the port is opened or not behind server firewall.
I know the port is open because when i turn on password auth, it works fine on the new port. But, not when i turn that off, and try to use a key.
 

zackrspv

Registered
Nov 22, 2011
3
0
51
cPanel Access Level
Root Administrator
I know the port is open, because if i have password authentication turned on, putty and secureCRT connect just fine on the new port.

But, if i turn off password auth, and just use public key authentication, it fails unless i'm port 22. That's why i'm askin :)
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
Please use verbose logging when you SSH (the -v option) and provide the failure message it is indicating for the connection attempt.