Ubuntu how to kill a socket that is listening?

1
Moses Hills asked a question: Ubuntu how to kill a socket that is listening?
Asked By: Moses Hills
Date created: Sun, Oct 31, 2021 11:59 AM
Date updated: Tue, Jun 28, 2022 5:47 PM

Content

Top best answers to the question «Ubuntu how to kill a socket that is listening»

Closing a socket in a running process is not impossible but difficult:

  1. locate the process : netstat -np. You get a source/destination ip:port portstate pid/processname map.
  2. locate the the socket's file descriptor in the process lsof -np $pid…
  3. Now connect the process: gdb -p $pid.
  4. Now close the socket:

Your Answer