Site Tools


netstat
найдем порт, которые использует ssh

# netstat -a -p -n | grep ssh

tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      16505/sshd      
tcp6       0      0 :::22                   :::*                    LISTEN      16505/sshd      
unix  2      [ ACC ]     STREAM     LISTENING     7032     1520/ssh-agent      /tmp/ssh-DOfouk1486/agent.1486
unix  2      [ ACC ]     STREAM     LISTENING     7460     1468/gnome-keyring- /tmp/keyring-ehhgwv/ssh

# netstat -naple|grep sendmail

tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      0          4351072    18951/sendmail: acc 
tcp        0      0 127.0.0.1:25                127.0.0.1:40629             ESTABLISHED 0          4351084    18962/sendmail: p93 
unix  2      [ ]         DGRAM                    4351052 18951/sendmail: acc 

netstat FreeBSD

1
Для просмотра портов и программ на них, используй sockstat

Discussion

Constantin Conovaloff, 2016/03/23 19:16
root@gitlab:/# netstat -anp | grep LISTEN
tcp        0      0 127.0.0.1:8080          0.0.0.0:*               LISTEN      -               
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      -               
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -               
tcp6       0      0 :::22                   :::*                    LISTEN      -               
You could leave a comment if you were logged in.
netstat.txt · Last modified: 2011/12/14 19:20 (external edit)

Page Tools