ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • 리눅스 열린 포트 확인하기
    프로그래밍/Linux 2016. 6. 18. 17:00
    반응형



    netstat -tnlp 를 사용하면 로컬 서버에서 현재 열려 있는 포트를 확인할 수 있다. 


    사용 옵션은 아래와 같다.



      netstat  [address_family_options]  [--tcp|-t]  [--udp|-u]  [--raw|-w]  [--listening|-l]  [--all|-a]

           [--numeric|-n]     [--numeric-hosts]     [--numeric-ports]     [--numeric-users]    [--symbolic|-N]

           [--extend|-e[--extend|-e]] [--timers|-o] [--program|-p] [--verbose|-v] [--continuous|-c]




    사용 예시 




    # netstat -tnlp

    Active Internet connections (only servers)

    Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name

    tcp        0      0 127.0.1.1:53            0.0.0.0:*               LISTEN      2209/dnsmasq

    tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1121/sshd

    tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      9770/cupsd

    tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN      1197/mysqld

    tcp        0      0 0.0.0.0:6001            0.0.0.0:*               LISTEN      1255/Xvnc4

    tcp6       0      0 :::22                   :::*                    LISTEN      1121/sshd

    tcp6       0      0 ::1:631                 :::*                    LISTEN      9770/cupsd

    tcp6       0      0 :::443                  :::*                    LISTEN      2171/apache2

    tcp6       0      0 :::5901                 :::*                    LISTEN      1255/Xvnc4

    tcp6       0      0 :::80                   :::*                    LISTEN      2171/apache2








    728x90
    반응형
Designed by Tistory.