對(duì)于 Linux 系統(tǒng)管理員來說,清楚某個(gè)服務(wù)是否正確地綁定或監(jiān)聽某個(gè)端口,是至關(guān)重要的。如果你需要處理端口相關(guān)的問題,這篇文章可能會(huì)對(duì)你有用。
端口是 Linux 系統(tǒng)上特定進(jìn)程之間邏輯連接的標(biāo)識(shí),包括物理端口和軟件端口。由于 Linux 操作系統(tǒng)是一個(gè)軟件,因此本文只討論軟件端口。軟件端口始終與主機(jī)的 IP 地址和相關(guān)的通信協(xié)議相關(guān)聯(lián),因此端口常用于區(qū)分應(yīng)用程序。大部分涉及到網(wǎng)絡(luò)的服務(wù)都必須打開一個(gè)套接字來監(jiān)聽傳入的網(wǎng)絡(luò)請(qǐng)求,而每個(gè)服務(wù)都使用一個(gè)獨(dú)立的套接字。
套接字是和 IP 地址、軟件端口和協(xié)議結(jié)合起來使用的,而端口號(hào)對(duì)傳輸控制協(xié)議(TCP)和用戶數(shù)據(jù)報(bào)協(xié)議(UDP)協(xié)議都適用,TCP 和 UDP 都可以使用 0 到 65535 之間的端口號(hào)進(jìn)行通信。
以下是端口分配類別:
在 Linux 上的 /etc/services 文件可以查看到更多關(guān)于保留端口的信息。
# less /etc/services # /etc/services: # $Id: services,v 1.55 2013/04/14 ovasik Exp $ # Network services, Internet style # IANA services version: last updated 2013-04-10 # Note that it is presently the policy of IANA to assign a single well-known # port number for both TCP and UDP; hence, most entries here have two entries # even if the protocol doesn't support UDP operations. # Updated from RFC 1700, ``Assigned Numbers'' (October 1994). Not all ports # are included, only the more common ones. # The latest IANA port assignments can be gotten from # http://www.iana.org/assignments/port-numbers # The Well Known Ports are those from 0 through 1023. # The Registered Ports are those from 1024 through 49151 # The Dynamic and/or Private Ports are those from 49152 through 65535 # Each line describes one service, and is of the form: # service-name port/protocol [aliases ...] [# comment] tcpmux 1/tcp # TCP port service multiplexer tcpmux 1/udp # TCP port service multiplexer rje 5/tcp # Remote Job Entry rje 5/udp # Remote Job Entry echo 7/tcp echo 7/udp discard 9/tcp sink null discard 9/udp sink null systat 11/tcp users systat 11/udp users daytime 13/tcp daytime 13/udp qotd 17/tcp quote qotd 17/udp quote msp 18/tcp # message send protocol (historic) msp 18/udp # message send protocol (historic) chargen 19/tcp ttytst source chargen 19/udp ttytst source ftp-data 20/tcp ftp-data 20/udp # 21 is registered to ftp, but also used by fsp ftp 21/tcp ftp 21/udp fsp fspd ssh 22/tcp # The Secure Shell (SSH) Protocol ssh 22/udp # The Secure Shell (SSH) Protocol telnet 23/tcp telnet 23/udp # 24 - private mail system lmtp 24/tcp # LMTP Mail Delivery lmtp 24/udp # LMTP Mail Delivery
本文題目:在Linux中查看進(jìn)程占用的端口號(hào)-創(chuàng)新互聯(lián)
網(wǎng)站鏈接:http://chinadenli.net/article46/deieeg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供微信小程序、微信公眾號(hào)、ChatGPT、網(wǎng)站營(yíng)銷、搜索引擎優(yōu)化、建站公司
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容