netstat

回覆文章
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

netstat

文章 yehlu »

yehlu@tt:~$ netstat -tu
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 240 0 li497-78.membe:http-alt 46.Red-88-16-14.d:50757 CLOSE_WAIT
tcp 250 0 li497-78.membe:http-alt 180.230.131.54:35812 CLOSE_WAIT
yehlu@tt:~$ netstat -tul
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 *:rsync *:* LISTEN
tcp 0 0 *:mysql *:* LISTEN
tcp 0 0 localhost.localdo:11211 *:* LISTEN
tcp 0 0 *:http-alt *:* LISTEN
tcp 0 0 *:ssh *:* LISTEN
tcp 0 0 *:smtp *:* LISTEN
tcp6 0 0 [::]:rsync [::]:* LISTEN
tcp6 0 0 [::]:www [::]:* LISTEN
tcp6 0 0 [::]:ssh [::]:* LISTEN
tcp6 0 0 [::]:https [::]:* LISTEN
udp 0 0 localhost.localdom:snmp *:*
udp 0 0 localhost.localdo:11211 *:*
udp 0 0 *:bootpc *:*
yehlu@tt:~$ netstat -tuln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:873 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:11211 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN
tcp6 0 0 :::873 :::* LISTEN
tcp6 0 0 :::80 :::* LISTEN
tcp6 0 0 :::22 :::* LISTEN
tcp6 0 0 :::443 :::* LISTEN
udp 0 0 127.0.0.1:161 0.0.0.0:*
udp 0 0 127.0.0.1:11211 0.0.0.0:*
udp 0 0 0.0.0.0:68 0.0.0.0:*
yehlu@tt:~$ netstat -tulnp
(No info could be read for "-p": geteuid()=1000 but you should be root.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:873 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:11211 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN -
tcp6 0 0 :::873 :::* LISTEN -
tcp6 0 0 :::80 :::* LISTEN -
tcp6 0 0 :::22 :::* LISTEN -
tcp6 0 0 :::443 :::* LISTEN -
udp 0 0 127.0.0.1:161 0.0.0.0:* -
udp 0 0 127.0.0.1:11211 0.0.0.0:* -
udp 0 0 0.0.0.0:68 0.0.0.0:* -
yehlu@tt:~$ sudo netstat -tulnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:873 0.0.0.0:* LISTEN 2627/xinetd
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 2405/mysqld
tcp 0 0 127.0.0.1:11211 0.0.0.0:* LISTEN 2492/memcached
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 2913/monitorix-http
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 2674/sshd
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 2594/master
tcp6 0 0 :::873 :::* LISTEN 5583/rsync
tcp6 0 0 :::80 :::* LISTEN 446/apache2
tcp6 0 0 :::22 :::* LISTEN 2674/sshd
tcp6 0 0 :::443 :::* LISTEN 446/apache2
udp 0 0 127.0.0.1:161 0.0.0.0:* 2609/snmpd
udp 0 0 127.0.0.1:11211 0.0.0.0:* 2492/memcached
udp 0 0 0.0.0.0:68 0.0.0.0:* 2454/dhclient3
yehlu@tt~$
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

Re: netstat

文章 yehlu »

netstat -tuanp | grep -v LISTEN | grep '':22
(No info could be read for "-p": geteuid()=1000 but you should be root.)
tcp 0 0 106.187.152.78:22 68.249.17.244:50837 ESTABLISHED -
tcp 0 0 106.187.152.78:22 68.249.17.244:60643 ESTABLISHED -
tcp 0 0 106.187.152.78:22 68.249.17.244:52946 ESTABLISHED -
tcp 0 0 106.187.152.78:22 68.249.17.244:60752 ESTABLISHED -
tcp 0 0 106.187.152.78:22 68.249.17.244:49313 ESTABLISHED -
tcp 265 0 106.187.152.78:8080 222.186.34.74:2207 CLOSE_WAIT -
tcp 0 0 106.187.155.78:22 68.249.17.244:50828 ESTABLISHED -
tcp 0 160 106.187.152.78:22 140.116.247.219:50283 ESTABLISHED -
回覆文章

回到「Linux」