Change Default SSH Port Number
![](https://steemitimages.com/640x0/https://moreabout.tech/wp-content/uploads/2016/08/ssh_cmd_line.jpg)
By default, SSH runs on port 22, and most scripts attack that port by brute force to attempt to gain access to your server. One way to stop script kiddies from brute forcing your SSH server so often is by changing the default port that OpenSSH uses. You must remember this port number and change all your connections that use SSH to the new port number. Remember you are doing this at your own risk!
Log into your server using SSH or the console. Navigate to the path of your SSH installation, by default its:
cd /etc/ssh/
The next thing you need to do is open the config file and actually edit it. In this example, I use nano (my favorite editor). Remember that if you only have access to SSH to connect to your server and no access to the console this may break your server if you are not careful.
nano sshd_config
You will notice a few lines down the line saying port 22 . Simply change this port number to whatever port you want, then save the file.
Next time you connect to your server, then the new port will need to be used, however, already connected sessions will still work. Although my server did not need a reboot to make the change take effect, I went ahead and did it for good measure to sever all current connections.
Credit goes to Techieshelp.com for showing me how to do this on my server!
Originally posted at https://moreabout.tech/change-default-ssh-port-number/
Congratulations @moreabout.tech! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :
Click here to view your Board
If you no longer want to receive notifications, reply to this comment with the word
STOP