-1

how do you close ports if there are not processes attached to it? I used to run an application and they're using this ports previously for some reason the application crashed but if i restart the application, i frequently need to change the port because the port is being used. But if I try to issue this command.

netstat -lnp

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name

    tcp6       0      0 :::8090                 :::*                    LISTEN      -
    tcp6       0      0 :::8080                 :::*                    LISTEN      -

PID/Program Name is not attached to a process its just "-". So anyone know hows to close off this port?

SOLVED

Just discovered that some process are being run by root and it would not show if you don't do sudo keyword before the command.

sudo netstat -tulpn

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name

tcp6       0      0 :::8090                 :::*                    LISTEN      1242/java
tcp6       0      0 :::8080                 :::*                    LISTEN      1491/java
1

When you execute netstat -tulpn it clearly shows

Not all processes could be identified, non-owned process info will not be shown,you would have to be root to see it all.

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.