For security reasons it is recommended to change the default SSH port 22.
To do so, open /etc/ssh/sshd_config configuration file with any text editor:
sudo vi /etc/ssh/sshd_config
You should see the following:
Change port 22 to any number above 1024 and save configuration file:
- Click Esc
- Type :wq
- Click Enter
Add your new port into firewall rules:
sudo ufw allow *port number*
Now you are able to ssh into your Shell using a non-default port.
Please sign in to leave a comment.