How do I change the default SSH port
You can change the SSH port by editing your
sshd_config. That file is located here:
You'll then need to edit the
Port line. If there is a
# in front of the line make sure to remove it.
Finally, run the following to restart SSH:
systemctl restart sshd
After that, you'll be able to connect to your Linode on the new port.
Do not forget to allow your new ssh port in iptables before you change it.
Also don't forget that after you change the SSH port, you will need to tell your SSH client to connect to the new port instead of the default port 22. For example, if your new SSH port is 4321, you would initiate a connection like so:
ssh email@example.com -p 4321