linux伺服器檢視tcp鏈結shell

2021-09-24 13:18:46 字數 894 閱讀 4858

netstat -nt |awk ' end '
tcp連線狀態詳解

listen: 偵聽來自遠方的tcp埠的連線請求

syn-sent: 再傳送連線請求後等待匹配的連線請求

syn-received:再收到和傳送乙個連線請求後等待對方對連線請求的確認

established: 代表乙個開啟的連線

fin-wait-1: 等待遠端tcp連線中斷請求,或先前的連線中斷請求的確認

fin-wait-2: 從遠端tcp等待連線中斷請求

close-wait: 等待從本地使用者發來的連線中斷請求

closing: 等待遠端tcp對連線中斷的確認

last-ack: 等待原來的發向遠端tcp的連線中斷請求的確認

time-wait: 等待足夠的時間以確保遠端tcp接收到連線中斷請求的確認

closed: 沒有任何連線狀態

1.你可以使用 lsof 命令來檢視某一埠是否開放。檢視埠可以這樣來使用,我就以80埠為例:

apt install lsof
lsof -i:80
如果有顯示說明已經開放了,如果沒有顯示說明沒有開放

2.netstat -aptn執行看看,是否監聽在0.0.0.0:3306

3.

netstat -nupl (udp型別的埠)

netstat -ntpl (tcp型別的埠)

4.telnet ip 埠號 方式測試遠端主機埠是否開啟

5 tcpdump

apt install tcpdump

linux伺服器檢視碟符及使用短鏈結

1 檢視碟符分割槽狀況 fdisk l 即可 2 檢視磁碟的使用狀態 命令 df h 即可檢視磁碟已經使用多少容量,剩餘多少容量等詳細資訊 例如我要遠端登陸伺服器,我需要些的內容可能是以下命令 ssh p 埠號 使用者名稱 ip位址 通過這樣的方式登陸伺服器時,每次登陸都要輸入一長串的命令,為了解決...

Linux檢視伺服器配置

linux檢視伺服器配置 伺服器型號 pangxl gec dmidecode grep system information a9 egrep manufacturer product 作業系統 pangxl gec cat etc redhat release centos release 6....

Linux下搭建tcp伺服器

include see notes include include include include include include include include socket bind listen accept send recv define server port 8888 define b...