安裝lsof:用來檢查哪些ports在使用和在運作。

root@tea:/usr/ports/sysutils/lsof # make install clean
.......................

====> Compressing man pages (compress-man)
===>  Installing for lsof-4.89.b,8
===>  Checking if lsof already installed
===>   Registering installation for lsof-4.89.b,8
Installing lsof-4.89.b,8...
===> SECURITY REPORT:
      This port has installed the following binaries which execute with
      increased privileges.
/usr/local/sbin/lsof

      If there are vulnerabilities in these programs there may be a security
      risk to the system. FreeBSD makes no guarantee about the security of
      ports included in the Ports Collection. Please type 'make deinstall'
      to deinstall the port if this is a concern.

      For more information, and contact details about the security
      status of this software, see the following webpage:
http://people.freebsd.org/~abe/
===>  Cleaning for lsof-4.89.b,8

root@tea:/usr/ports/sysutils/lsof # lsof -i
lsof: WARNING: access /root/.lsof_tea: No such file or directory
lsof: WARNING: created device cache file: /root/.lsof_tea
COMMAND   PID   USER   FD   TYPE     DEVICE SIZE/OFF NODE NAME
syslogd   915   root    6u  IPv6 0xc845b7c0      0t0  UDP *:syslog
syslogd   915   root    7u  IPv4 0xc845b7b0      0t0  UDP *:syslog
ntpd     1014   root   20u  IPv4 0xc845b790      0t0  UDP *:ntp
ntpd     1014   root   21u  IPv6 0xc845b7a0      0t0  UDP *:ntp
ntpd     1014   root   22u  IPv4 0xc845b780      0t0  UDP tea:ntp
ntpd     1014   root   23u  IPv6 0xc845b770      0t0  UDP [fe80:2::202:b3ff:fe98         :ed38]:ntp
ntpd     1014   root   24u  IPv6 0xc845b760      0t0  UDP localhost:ntp
ntpd     1014   root   25u  IPv6 0xc845b750      0t0  UDP [fe80:3::1]:ntp
ntpd     1014   root   26u  IPv4 0xc845b740      0t0  UDP localhost:ntp
sshd     1042   root    3u  IPv6 0xc8758000      0t0  TCP *:ssh (LISTEN)
sshd     1042   root    4u  IPv4 0xc8757bc0      0t0  TCP *:ssh (LISTEN)
sshd     7461   root    3u  IPv4 0xcb700000      0t0  TCP tea:ssh->192.9.100.117         :xinuexpansion3 (ESTABLISHED)
sshd     7464 neroli    3u  IPv4 0xcb700000      0t0  TCP tea:ssh->192.9.100.117         :xinuexpansion3 (ESTABLISHED)
named   78695   bind   20u  IPv4 0xc86afbc0      0t0  TCP tea:domain (LISTEN)
named   78695   bind   21u  IPv4 0xc86b02f0      0t0  TCP localhost:domain (LIST         EN)
named   78695   bind   22u  IPv4 0xc86b05e0      0t0  TCP localhost:rndc (LISTEN         )
named   78695   bind   23u  IPv6 0xc86ae000      0t0  TCP localhost:rndc (LISTEN         )
named   78695   bind  512u  IPv4 0xc845bf00      0t0  UDP tea:domain
named   78695   bind  513u  IPv4 0xc845bf00      0t0  UDP tea:domain
named   78695   bind  514u  IPv4 0xc845bef0      0t0  UDP localhost:domain
named   78695   bind  515u  IPv4 0xc845bef0      0t0  UDP localhost:domain
mpd5    79550   root   16u  IPv4 0xc87572f0      0t0  TCP localhost:5005 (LISTEN         )
mpd5    79550   root   19u  IPv4 0xc87575e0      0t0  TCP *:5006 (LISTEN)
root@tea:/usr/ports/sysutils/lsof #

可以看到目前機器在跑ntp, ssh, named, mpd5。

 

,

貓熊麗麗 發表在 痞客邦 PIXNET 留言(0) 人氣()