Knowledgebase

How to change SSH port number Print

  • SSH, cpanel, Linux
  • 0

After login SSH then paste the command on your terminal

[root@dinisoft]# netstat -tulnp | grep ssh

There was showing

0.0.0.0:22

You may try second command

[root@dinisoft]# nano /etc/ssh/sshd_config

Now opened text editor on your command line screen, you should find port number 22

Just replace port number from 22 to [different any number & delete # character front on the line. ]

then restart SSHD

[root@dinisoft]# systemctl restart sshd

now try again on the first command before exit for confirmation.


Was this answer helpful?
« Back