Im new to ubuntu and using ubuntu server 12.04.
When I run nmap localhost
I get the following output :
Not shown: 997 closed ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
3306/tcp open mysql
This means that port 443(https) is closed. I want to open it. So I did the following :
I ran the command
sudo iptables -A INPUT -p tcp --dport 443 -j ACCEPT
And to persist the changes I saved the file using sudo sh -c "iptables-save > /etc/iptables.rules"
and then I added the following lines to etc/network/interfaces
:
pre-up iptables-restore < /etc/iptables.rules
post-down iptables-save > /etc/iptables.rules
After rebooting my system I ran sudo iptables -L
and the line
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:https
was visible.
However now when I run nmap localhost
I still dont see 443 as open.
Please help!
I bet you have nothing listening to port 443 on your host. Try this: in one terminal run sudo nc -lk 443
and then run your nmap localhost
. This may not have anything to do with an iptables firewall rule.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With