How to change SSH port number

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.

  • SSH, cpanel, Linux
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to Install ConfigServer Security & Firewall (csf)

cd /tmp rm -fv csf.tgz wget https://download.configserver.com/csf.tgz tar -xzf csf.tgz cd csf...

How to Install ConfigServer Mail Queues

cd /usr/src rm -fv /usr/src/cmq.tgz wget http://download.configserver.com/cmq.tgz tar -xzf...