亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

Linux測(cè)試端口連通性的5種方法

 更新時(shí)間:2024年06月17日 11:19:02   作者:wacpguo  
在Linux系統(tǒng)中,測(cè)試端口通不通是非常常見的情況之一,比如我們進(jìn)行網(wǎng)絡(luò)調(diào)試的時(shí)候就需要測(cè)試驗(yàn)證對(duì)應(yīng)的端口是否正常,那么Linux中測(cè)試端口通不通的方法是什么?以下是詳細(xì)內(nèi)容介紹

1、curl

(1)curl   -v  ip:port

[root@localhost ~]# curl -v 192.168.120.15:37777
* About to connect() to 192.168.120.15 port 37777 (#0)
*   Trying 192.168.120.15...
* Connected to 192.168.120.15 (192.168.120.15) port 37777 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.29.0
> Host: 192.168.120.15:37777
> Accept: */*
>

(2)curl  -kv https://ip:port

?
[root@localhost ~]# curl -kv https://192.168.12.15:3789
 
* About to connect() to 192.168.12.15 port 3789 (#0)
*   Trying 192.168.12.15...
* Connected to 192.168.12.15 (192.168.12.15) port 3789 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* skipping SSL peer certificate verification
* SSL connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* Server certificate:
*       subject: CN=cn.com.ca.d6.agent
*       start date: 4月 26 03:51:05 2021 GMT
*       expire date: 4月 26 03:51:05 2041 GMT
*       common name: cn.com.ca.d6.agent
*       issuer: CN=cn.com.ca.d6.agent
> GET / HTTP/1.1
> User-Agent: curl/7.29.0
> Host: 192.168.12.15:3789
> Accept: */*
>
< HTTP/1.1 404
< Connection:close
< Content-Length:22
< Content-Type:text/html
< X-Frame-Options:sameorigin
<
* Closing connection 0
<html>not found</html>

2、nc

(1)nc -nv    ip  port

[root@localhost ~]# nc -nv 192.168.12.15 3789
Ncat: Version 7.50 ( https://nmap.org/ncat )
Ncat: Connected to 192.168.12.15:3789.
^C

(2)nc -nvv  ip  port

?
[root@localhost ~]# nc -nvv 192.168.12.15 3789
Ncat: Version 7.50 ( https://nmap.org/ncat )
NCAT DEBUG: Using system default trusted CA certificates and those in /usr/share/ncat/ca-bundle.crt.
NCAT DEBUG: Unable to load trusted CA certificates from /usr/share/ncat/ca-bundle.crt: error:02001002:system library:fopen:No such file or directory
libnsock nsi_new2(): nsi_new (IOD #1)
libnsock nsock_connect_tcp(): TCP connection requested to 192.168.12.15:3789 (IOD #1) EID 8
libnsock nsock_trace_handler_callback(): Callback: CONNECT SUCCESS for EID 8 [192.168.12.15:3789]
Ncat: Connected to 192.168.12.15:3789.
libnsock nsi_new2(): nsi_new (IOD #2)
libnsock nsock_read(): Read request from IOD #1 [192.168.12.15:3789] (timeout: -1ms) EID 18
libnsock nsock_readbytes(): Read request for 0 bytes from IOD #2 [peer unspecified] EID 26
^C

3、ssh

(1)ssh  -v  -p  port  username@ip      // username任意

[root@localhost ~]# ssh -v -p 3789 root@192.168.12.15
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 58: Applying options for *
debug1: Connecting to 192.168.120.15 [192.168.12.15] port 3789.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.4
^C

4、wget

(1)wget   ip:port

[root@localhost ~]# wget 192.168.12.15:3789
--2023-03-25 17:05:20--  http://192.168.12.15:3789/
正在連接 192.168.120.15:37777... 已連接。
已發(fā)出 HTTP 請(qǐng)求,正在等待回應(yīng)... ^C?

5、telnet

(1)telnet   ip   port

[root@localhost ~]# telnet 192.168.12.15 3789
Trying 192.168.12.15...
Connected to 192.168.12.15.
Escape character is '^]'.
^CConnection closed by foreign host.

端口通 != 業(yè)務(wù)通

tcp端口通,上面跑的http業(yè)務(wù)可能不通(代理限制)。

tcp層:nc,ssh,telnet

http層:curl,wget

到此這篇關(guān)于Linux測(cè)試端口連通性的5種方法的文章就介紹到這了,更多相關(guān)Linux測(cè)試端口內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • apache使用.htaccess文件實(shí)現(xiàn)屏蔽wget下載網(wǎng)站內(nèi)容

    apache使用.htaccess文件實(shí)現(xiàn)屏蔽wget下載網(wǎng)站內(nèi)容

    wget是一個(gè)從網(wǎng)絡(luò)上自動(dòng)下載文件的自由工具,支持通過HTTP、HTTPS、FTP三個(gè)最常見的TCP/IP協(xié)議下載,并可以使用HTTP代理。wget名稱的由來是“World Wide Web”與“get”的結(jié)合。
    2014-07-07
  • 在Linux里安裝和啟動(dòng)nginx的方法

    在Linux里安裝和啟動(dòng)nginx的方法

    本篇文章主要介紹了在Linux里安裝和啟動(dòng)nginx的方法,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2018-05-05
  • Linux下的SVN服務(wù)器搭建步驟

    Linux下的SVN服務(wù)器搭建步驟

    本篇文章主要介紹了Linux下的SVN服務(wù)器搭建步驟,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2017-03-03
  • 一文詳解Linux中的fork機(jī)制

    一文詳解Linux中的fork機(jī)制

    fork() 是一種系統(tǒng)調(diào)用,用于在操作系統(tǒng)中創(chuàng)建新進(jìn)程,當(dāng) fork() 被調(diào)用時(shí),會(huì)生成一個(gè)當(dāng)前進(jìn)程的副本(稱為子進(jìn)程),而原始進(jìn)程則被稱為父進(jìn)程,本文給大家詳細(xì)介紹了Linux中的fork機(jī)制,需要的朋友可以參考下
    2025-03-03
  • CentOS 7安裝配置圖文教程

    CentOS 7安裝配置圖文教程

    這篇文章主要為大家詳細(xì)介紹了CentOS 7安裝配置圖文教程,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2016-10-10
  • linux服務(wù)器上openssl版本升級(jí)方式

    linux服務(wù)器上openssl版本升級(jí)方式

    文章詳細(xì)介紹了在Linux服務(wù)器上升級(jí)OpenSSL版本的步驟,包括查看當(dāng)前版本、檢查yum源、下載源碼、編譯安裝、創(chuàng)建軟鏈、更新動(dòng)態(tài)鏈接庫以及驗(yàn)證版本
    2025-03-03
  • linux中ssh免密通信的實(shí)現(xiàn)

    linux中ssh免密通信的實(shí)現(xiàn)

    這篇文章主要介紹了linux中ssh免密通信的實(shí)現(xiàn),詳細(xì)的介紹了什么是ssh及其ssh免密通信,非常具有實(shí)用價(jià)值,需要的朋友可以參考下
    2018-11-11
  • VMware虛擬機(jī)中Ubuntu18.04無法連接網(wǎng)絡(luò)的解決辦法

    VMware虛擬機(jī)中Ubuntu18.04無法連接網(wǎng)絡(luò)的解決辦法

    這篇文章主要為大家詳細(xì)介紹了VMware虛擬機(jī)中Ubuntu18.04無法連接網(wǎng)絡(luò)的解決辦法,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2019-03-03
  • Linux usermod 命令的使用

    Linux usermod 命令的使用

    這篇文章主要介紹了Linux usermod 命令的使用,幫助大家更好的理解和學(xué)習(xí)Linux,感興趣的朋友可以了解下
    2020-08-08
  • Centos7 Mysql 5.6 多主一從 解決方案與詳細(xì)配置

    Centos7 Mysql 5.6 多主一從 解決方案與詳細(xì)配置

    這篇文章主要介紹了Centos7 Mysql 5.6 多主一從 解決方案與詳細(xì)配置,需要的朋友可以參考下
    2016-04-04

最新評(píng)論