How to Change SSH Port

Allow firewall.

sudo iptables -I INPUT -p tcp --dport 22122 -j ACCEPT
sudo netfilter-persistent save

Change ssh port.

echo "Port 22122" | sudo tee /etc/ssh/sshd_config.d/90_port.conf
sudo systemctl restart sshd

Rollback.

sudo rm -f /etc/ssh/sshd_config.d/90_port.conf
sudo systemctl restart sshd