Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

I have a ubuntu server

How can i open a port ?

I have flushed the iptables and off'ed ufw

Provide me steps how to open a tcp port

share|improve this question
Is there a service already listening in that port? – hmontoliu Aug 3 '11 at 21:43
Please provide (as an edit to your question) the output of iptables -L INPUT -v -n and the port you want opening – Iain Aug 3 '11 at 21:51

Your question is overly vague and probably insufficient to help you do what you're actually trying to do, but if you just want to open a port you can do it like so:

nc -l -p PORT_NUMBER

You can then pass data received on that port to a script by doing:


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.