端口测试

telnet

1
telnet ip port

curl

1
2
3
4
5
6
7
# 通
[root@hexo source]# curl 43.133.164.41:7788
curl: (52) Empty reply from server

# 不通
[root@hexo source]# curl 43.133.164.41:22
curl: (28) Failed to connect to 43.133.164.41 port 22: Connection timed out

wget

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 不通
[root@hexo source]# wget 43.133.164.41:22
--2025-02-14 15:41:01-- http://43.133.164.41:22/
Connecting to 43.133.164.41:22...
failed: Connection timed out.
Retrying.

--2025-02-14 15:43:14-- (try: 2) http://43.133.164.41:22/
Connecting to 43.133.164.41:22...

# 通
[root@hexo source]# wget 43.133.164.41:7788
--2025-02-14 15:44:53-- http://43.133.164.41:7788/
Connecting to 43.133.164.41:7788... connected.
HTTP request sent, awaiting response... No data received.
Retrying.

--2025-02-14 15:44:54-- (try: 2) http://43.133.164.41:7788/
Connecting to 43.133.164.41:7788... connected.
HTTP request sent, awaiting response... No data received.
Retrying.

ssh

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# 不通
[root@hexo source]# ssh -v -p 22 43.133.164.41
OpenSSH_8.7p1, OpenSSL 3.0.7 1 Nov 2022
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Reading configuration data /etc/ssh/ssh_config.d/50-redhat.conf
debug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config
debug1: configuration requests final Match pass
debug1: re-parsing configuration
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Reading configuration data /etc/ssh/ssh_config.d/50-redhat.conf
debug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config
debug1: Connecting to 43.133.164.41 [43.133.164.41] port 22.
debug1: connect to address 43.133.164.41 port 22: Connection timed out
ssh: connect to host 43.133.164.41 port 22: Connection timed out

# 通
[root@hexo source]# ssh -v -p 7788 43.133.164.41
OpenSSH_8.7p1, OpenSSL 3.0.7 1 Nov 2022
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Reading configuration data /etc/ssh/ssh_config.d/50-redhat.conf
debug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config
debug1: configuration requests final Match pass
debug1: re-parsing configuration
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Reading configuration data /etc/ssh/ssh_config.d/50-redhat.conf
debug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config
debug1: Connecting to 43.133.164.41 [43.133.164.41] port 7788.
debug1: Connection established. # 已连接
debug1: identity file /root/.ssh/id_rsa type 0
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
debug1: identity file /root/.ssh/id_ecdsa_sk type -1
debug1: identity file /root/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /root/.ssh/id_ed25519 type -1
debug1: identity file /root/.ssh/id_ed25519-cert type -1
debug1: identity file /root/.ssh/id_ed25519_sk type -1
debug1: identity file /root/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /root/.ssh/id_xmss type -1
debug1: identity file /root/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.7
kex_exchange_identification: Connection closed by remote host
Connection closed by 43.133.164.41 port 7788