Changing the default SSH port The default SSH port is 22. In order to mitigate some attacks, it is interesting to change the port to be used in an SSH connection. Of course this will not avoid hacker attacks, just make a little bit harder.
You can start opening /etc/hosts file, using your preferred editor. Mine is vim ;).
sudo vim /etc/hosts Uncomment and change “Port” entry.
#Port 22 To something like