Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
  • My wireless is listening on
  • SSH is listening on
  • No firewall is running
  • TCP wrappers are not configured,
  • I can connect wirelessly to the Internet
  • My kernel logs show that I'm trying to connect from another host, but an nmap scan shows all ports are closed.

How do I get a port to open?

share|improve this question

migrated from Mar 20 '11 at 12:16

This question came from our site for system and network administrators.

When... What? It's kind of helpful if you finish the title. – Wuffers Mar 20 '11 at 14:44

Do you have public IP address? Where do you run NMAP? It sounds like you are trying to use your local network IP from Internet. Effectively the computers aren't same network and cannot reach each other. Instead, you should use internet facing IP address.

Before checking if ports are open try to run ping command between hosts.

On source computer:


If ping packets go through it is possible to form a connection between two computers.

Then you can also run netstat -l command on the host computer to see that SSH daemon really listens to port 22:

netstat -l
share|improve this answer

Your question isn't very clear, would you mind clarifying?

Unless a service is running on a port nmap wont show it as open. In Ubuntu as far as I know the default policy for iptables is ACCEPT, so if you start up a service running on X port it will be put through the firewall without any issues. So those ports arent really "closed" in the sense that they are blocked, its just that there is nothing there to listen for anything on them.

That being said If you want to explicitly open a port you can open it with iptables

iptables -I INPUT -p tcp --dport 22 -j ACCEPT
iptables -I INPUT -p udp --dport 53 -j ACCEPT

You can change the -p to a different protocol, and the --dport to a different port number. iptables has a whole bunch of other options that you can look into. The -j ACCEPT can be changed to DROP or REJECT if you want to block them.

share|improve this answer

You must log in to answer this question.