2

I was trying to kill a process which was running on the port 8080 and utilize it for remote debugging purpose.

Where my source code is on my host machine, and the compiled jar is in another Ubuntu server. Hence I was trying to do remote debugging on the port 8080, I changed the necessary parameters on my IntelliJ configuration in order to proceed with the remote debugging and I tried running the jar from ths server machine as such:

java -jar -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8080 hdfstohive-1.0-SNAPSHOT-jar-with-dependencies.jar

Since I killed the process which was running on my server machine, now I'm not able to see the port being opened when I did nmap serverip and netstat -atun as well.

So I tried adding it to the firewall (sudo ufw allow 8080/tcp) rule and in the iptable (sudo iptables -I INPUT -p tcp -s 0.0.0.0/0 --dport 8080 -j ACCEPT) as well, still, I'm not able to see the port being opened. I've also tried disabling the firewall as well, but still no luck.

So what I need is, to make that port open so that I can do the remote debugging from my host machine. I'm sure I'm missing out something crucial on what I've done already.

Am I heading towards a downfall? Any help could be appreciated.

1 Answer 1

10

On Ubuntu all ports are opened unless you have a firewall or application that is blocking it. Under normal circumstances, the application running on the port is for LISTENING. So that it can receive from the port.

The Blocking or Closing of the port is using a reference to a firewall block.

So, if you are not blocking the port by your firewall, it's opened.

A port is usually considered opened when there is a program running and LISTENING on the port. You can tell which ports have programs running (LISTENING) with this command (among many other commands):

$ netstat -tulnp | grep "LISTEN"

You can identify which application is using the port with this command (in this case checking port 80):

$ sudo lsof -i tcp:80

Port Opened

You mentioned that you killed the process which was running on your server machine, and now not able to see the port being opened. You don't see it being opened because there isn't anything running on it.

You can test your port in question by running netcat on it. Netcat is a utility for TCP and UDP connections and listens.

Run this on your port:

$ netcat -l 1234

Then from a different computer run the following:

$ telnet serverIP 1234
Trying 192.168.15.81...
Connected to ubunzeus.apollo3.com.
Escape character is '^]'.
this is a test

You'll notice the "This is a test" text will appear on your server console. This is a way to test the port. You can hit Ctrl+C on the server to cancel the application after the test.

Hope that helped to clarify what's happening on your ports.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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