Answered by the Webhosting Experts
Tags +
...

Hivelocity
Dedicated Servers

Bare Metal Computing
Tired of overpaying for outdated hardware or nonexistent technical support?

Click here to chat with one of our highly skilled account managers for Hivelocity's latest server deals or browse our bare metal servers by clicking the link below.

Tags +
...
Tags
...
...
160x600_hivelocity_dec20

How can I change the port ssh listens on?

You can edit sshd_config to change the port sshd listens on. The default directory for ssh configuration is /etc/ssh.
Backup the current configuration and use your favorite editor to change the Port line:

root@root [~]# cd /etc/ssh/
root@root [/etc/ssh]# cp sshd_config sshd_config.save
root@root [/etc/ssh]# vi sshd_config

#Port 22

I will set mine to port 4000. Do not forget to remove the comment (#).

Port 4000

root@root [/etc/ssh]# diff sshd_config sshd_config.save
13c13
< Port 4000

> #Port 22
root@root [/etc/ssh]#

Restart sshd and verify that it is listening on the new port.

root@root [/etc/ssh]# /etc/init.d/sshd restart
Stopping sshd:                                             [  OK  ]
Starting sshd:                                             [  OK  ]
root@root [/etc/ssh]# netstat -anp | grep sshd
tcp        0      0 0.0.0.0:4000                0.0.0.0:*                   LISTEN      1605/sshd

Share

Facebook
Twitter
LinkedIn
Email
WhatsApp

Need More Personalized Help?

If you have any further issues, questions, or would like some assistance checking on this or anything else, please reach out to us from your my.hivelocity.net account and provide your server credentials within the encrypted field for the best possible security and support.

If you are unable to reach your my.hivelocity.net account or if you are on the go, please reach out from your valid my.hivelocity.net account email to us here at: support@hivelocity.net. We are also available to you through our phone and live chat system 24/7/365.

Watch our servers in their natural habitat

Click here to see more live streams or take a tour of our facilities.

Hivelocity
Dedicated Servers

Bare Metal Computing
Tired of overpaying for outdated hardware or nonexistent technical support?

Click here to chat with one of our highly skilled account managers for Hivelocity's latest server deals or browse our bare metal servers by clicking the link below.