linux端口开放多少好,Linux检查端口开放的七种方法

Linux, 检查端口开放的七种方法

telnet# yum -y install telnet

# telnet 10.0.0.51 22

Trying 10.0.0.51...

Connected to 10.0.0.51.

Escape character is '^]'.

SSH-2.0-OpenSSH_7.4

按ctrl+alt+]退出

2. nmap# nmap -p 22 10.0.0.51

Starting Nmap 6.40 ( http://nmap.org ) at 2018-08-27 09:32 CST

Nmap scan report for bogon (10.0.0.51)

Host is up (0.000043s latency).

PORT   STATE SERVICE

22/tcp open  ssh            --> open即开放

Nmap done: 1 IP address (1 host up) scanned in 0.03 seconds

3. nc# nc -z -v -n 10.0.0.51 22

Ncat: Version 7.50 ( https://nmap.org/ncat )

Ncat: Connected to 10.0.0.51:22.

Ncat: 0 bytes sent, 0 bytes received in 0.03 seconds.

参数说明:

-z: 端口扫描模式

-v: 显示详细信息

-n: 以数字的形式显示,即不反向解析

4. tcping# yum -y install tcping

# tcping 10.0.0.51 22

10.0.0.51 port 22 open.

5.echo >/dev/tcp/localhost/22 && echo "open"

6. netstat|ss# ss -ltnp|grep -w 22

LISTEN     0      128          *:22                       *:*                   users:(("sshd",pid=1210,fd=3))

LISTEN     0      128         :::22                      :::*                   users:(("sshd",pid=1210,fd=4))

7. lsof# lsof -i :22

COMMAND   PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME

sshd     1210 root    3u  IPv4  20218      0t0  TCP *:ssh (LISTEN)

sshd     1210 root    4u  IPv6  20220      0t0  TCP *:ssh (LISTEN)

sshd    23635 root    3u  IPv4 188315      0t0  TCP bogon:ssh->bogon:acmsoda (ESTABLISHED)

sshd    23789 root    3u  IPv4 192038      0t0  TCP bogon:ssh->bogon:7238 (ESTABLISHED)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值