SSH Port change problem for SFTP

Nov 30, 2018
17
5
78
Texas
cPanel Access Level
Root Administrator
Good day,
I am able to change the port via following How to Secure SSH - cPanel Knowledge Base - cPanel Documentation and Tips to Make Your Server More Secure - cPanel Knowledge Base - cPanel Documentation...
I had did a "netstat -lnp | grep sshd" and it shows my "new" port as well. So I logout of the ssh connection and go to relogin via the new port and it just sits there and then says connection timed out. It doesn't ask me for my login details or anything.

So I have to go into WHM and to terminal and change it back to default 22. Boom everything works back the way it should. What am I missing?

Then I've tried to login even on port 22 via SFTP and it doesn't work. I am told that I need to enable Shell Access. But I've read from this "fairly old thread" that I don't need Shell Access enabled to get it to work? SFTP without Shell Access?

Thank you for all the help.
 

HostSane

Member
Nov 26, 2018
17
4
3
Mumbai
cPanel Access Level
Root Administrator
When you are changing the SSH the port to some different port , make sure you have opened that port in firewall , that is either iptables or CSF and that should fix the issue.
 
  • Like
Reactions: cPanelLauren

ronaldst

Well-Known Member
Feb 22, 2016
85
16
8
Norway
cPanel Access Level
Root Administrator
Without knowing for sure it appears reasonable to think your new port is blocked by the firewall.

Are you running CSF?

Shell access is required for the user you try to login with. By default root got SSH access if not configured otherwise.

SFTP uses the same port as SSHD.
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,301
363
Houston
As suggested already here you need to ensure the new port is added in the firewall, you also need to ensure that you restart the sshd service once you modify the port.
 
Nov 30, 2018
17
5
78
Texas
cPanel Access Level
Root Administrator
Thank you for the reply's. Apparently I didn't set to get notified of reply's.

I will check to see if it is a firewall issue. I didn't setup a "server" firewall but it may still set it up automatically.
I will report back with my findings.
Thank you for the feedback.
 
  • Like
Reactions: cPanelLauren