Thursday, October 2, 2008

How to open port on Linux?

By default Linux Operating Systems has a few ports open such as SSH(22) FTP(21) etc... However, we need more ports needed to open for another applications such as admin panels, several servers like apache, mysql and so on.
Open file with your favorite editor my own is vi:
# vi /etc/sysconfig/iptables
Add following line to the file to enable https:// which is secure http for your server :
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT

You can change 443 port to which port you want to enable incoming transfers.

After doing changes you shoul restart network adapter with command on RHEL, CentOS, Fedora using:
# service iptables restart

For other Linux OS'es you can reboot or restart iptables somehow.

No comments: