Kyl*_*idt 2 linux ssh fedora netstat linode
在我的 Linode 上 sudo netstat -tulp 给了我:
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 *:ssh *:* LISTEN 2030/sshd
tcp 0 0 *:http *:* LISTEN 2178/httpd
tcp 0 0 *:ssh *:* LISTEN 2030/sshd
udp 0 0 *:bootpc *:* 1937/dhclient
Run Code Online (Sandbox Code Playgroud)
为什么 sshd 在那里两次?
其中之一是侦听 IPv4 连接,一个是侦听 IPv6 连接:
michael:~> netstat -tl |grep ssh
tcp 0 0 *:ssh *:* LISTEN
tcp 0 0 *:ssh *:* LISTEN
michael:~> netstat -tln |grep 22
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 :::22 :::* LISTEN
Run Code Online (Sandbox Code Playgroud)