Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
2  
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

1 Answer 1

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:

nc -l -p PORT_NUMBER | SCRIPT

share|improve this answer

Your Answer

 
discard

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.