how to open port in ubuntu?

3

1

I have open port 3003 that working correctly on all remote connection .

When I type command:

netstat -tupan | grep 3003

then it gives output

$ netstat -tupan | grep 3003
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 0.0.0.0:3003            0.0.0.0:*               LISTEN      22455/node  

Now I need to open port 8802 for remote connection

When I type same command for port 8802 :

netstat -tupan | grep 8802

then it gives output like

$ netstat -tupan | grep 8802
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 127.0.0.1:8802          0.0.0.0:*               LISTEN      -               

What is the diference between them and how I can open 8802 port like 3003 ?

Shubham Batra

Posted 2015-08-03T04:35:53.127

Reputation: 133

Answers

3

Ports are opened as soon as there is an application listening to them. For instance, if you install openssh-server, then port 25 TCP is open. If you then go into the configuration file and change the port from 25 to 48 and restart the server, 48 will be open and 25 closed.

So, basically, whenever an application is listening, the port will be open.

What you basically think about are packet filters like iptables. If you previously configured a packet filter, then this is an additional layer. If you have configured it the most common way, then every port will be closed by this packet filter except for the ones you specifically allow. How those are configured is described in the single packet filter manuals.

Also, another device can block a port. So, basically, if everything goes through your router, then it can be stopped there and has to be configured there.

But basically, a port is 'open' as soon as your having an application listening to this port. If there is no application listening, the data packages will be discarded.

TheCommoner282

Posted 2015-08-03T04:35:53.127

Reputation: 363

As a side note: port 25 is actually SMTP. The default ssh-port is 22. – he1ix – 2015-08-03T20:43:13.110

ups.. yeah.. he1ix is right :P – TheCommoner282 – 2015-08-03T20:44:10.670