我无法找到我将尝试实现的简单事情的答案:一旦与我的linux服务器建立了tcp连接,假设ssh / tcp 22或x11 / tcp 6000显示->如何关闭此连接而不需要终止进程(sshd / x11 显示服务器)。我还看到一些使用 iptables 的建议,但它对我不起作用,连接在 netstat -an 中仍然可见。如果有人能指出我正确的方向,那就太好了。
到目前为止我尝试过的
tcpkill: kills the process, not good for me
iptables: does not close the established connection, but prevent further connections.
Run Code Online (Sandbox Code Playgroud)
提前感谢 DJ