On Redhat 7 Linux server you can manage firewall rules with a firewall-cmd command. The following linux command will open SSH port 22 on Redhat 7 Linux server:
[root@rhel7 ~]# firewall-cmd --zone=public --add-port=22/tcp --permanent
To apply your new firewall settings you need reload firewall:
[root@rhel7 ~]# firewall-cmd --reload
open port 22 ssh on redhat 7 linux server

You can check whether the SSH port 22 is open by using iptables command:
[root@rhel7 ~]# iptables-save | grep 22
-A IN_public_allow -p tcp -m tcp --dport 22 -m conntrack --ctstate NEW -j ACCEPT
check for open port 22 ssh on redhat 7 linux server
IF you later decide to change your firewall rule and to block port 22 this can be done by:
[root@rhel7 ~]# firewall-cmd --zone=public --remove-port=22/tcp --permanent
success
[root@rhel7 ~]# firewall-cmd --reload
success
ARE YOU LOOKING FOR A LINUX JOB?
Submit your RESUME, create a JOB ALERT or subscribe to RSS feed on LinuxCareers.com.
LINUX CAREER NEWSLETTER
Subscribe to NEWSLETTER and receive latest news, jobs, career advice and tutorials.
DO YOU NEED ADDITIONAL HELP?
Get extra help by visiting our LINUX FORUM or simply use comments below.

You may also be interested in: