I want to change my SSH port on CentOS.
But first I want to make sure the port is open before doing this.
Since SSH is the only way for me to access the server and I don't want to lock myself out :-)
I've used the following two commands to add an iptables rule:
iptables -I INPUT -p tcp --dport 4444 -j ACCEPT /etc/init.d/iptables save
After that I've tested it with the following command:
nmap -v -sV localhost -p 4444
With the following result:
Host localhost.localdomain (127.0.0.1) appears to be up ... good. Interesting ports on localhost.localdomain (127.0.0.1): PORT STATE SERVICE VERSION 4444/tcp closed unknown
The state is
closed so it looks like I haven't properly opened the port.
What should I do to open the port?