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

查看:166
本文介绍了释放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天全站免登陆