Simple change ssh port debian

Edit the file and set Port option

Type the following command:
$ sudo vi /etc/ssh/sshd_config
Locate line that read as follows:
Port 22
#Port 22
To set the port to 2222/ other, enter:
Port 2222

The syntax for iptables is as follows
$ sudo /sbin/iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 2222 -j ACCEPT

then restart

$ sudo systemctl restart ssh