Change the SSH Port On Ubuntu
For example, changing the default ssh port to use 20040 instead of 22…
- Edit
/etc/ssh/sshd_config
, uncomment the linePort 22
to sayPort 20040
sudo sytemctl restart ssh
- Run
netstat -tulpn | grep ssh
and make sure ssh is listening on 20040 - Make sure ubuntu firewall allows it, run
sudo ufw allow 20040/tcp
- Lastly, make sure you have your cloud level firewall rules also set up to allow access to that port.
Last modified: