释放 TCP/IP 端口? [英] Freeing up a TCP/IP port?

查看:28
本文介绍了释放 TCP/IP 端口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

netstat -tulnap显示正在使用的端口.如何在 Linux 中释放端口?

netstat -tulnap shows me what ports are in use. How to free up a port in Linux?

推荐答案

正如其他人所说,您必须终止所有侦听该端口的进程.最简单的方法是使用 fuser(1) 命令.例如,要查看在端口 80 上侦听 HTTP 请求的所有进程(以 root 身份运行或使用 sudo):

As the others have said, you'll have to kill all processes that are listening on that port. The easiest way to do that would be to use the fuser(1) command. For example, to see all of the processes listening for HTTP requests on port 80 (run as root or use sudo):

# fuser 80/tcp

如果你想杀死他们,那么只需添加 -k 选项.

If you want to kill them, then just add the -k option.

这篇关于释放 TCP/IP 端口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆