Ubuntu Change SSH Port

Open SSH config file

nano /etc/ssh/sshd_config

There should be string Port you can use Ctrl+w to search for it, so you will find something like

Port 22

change 22, for example to 21989, now restart SSH service

service ssh restart

You can also open port if it’s closed

sudo ufw allow 21989/tcp

Leave a Reply

Your email address will not be published. Required fields are marked *