본문 바로가기

LINUX

[리눅스] 열린 포트 확인


리눅스 열린 포트 확인 방법 


netstat -nltp


   [root@localhost ~]# netstat -nltp

    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:111             0.0.0.0:*               LISTEN      1/systemd

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

    tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1662/master

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

    tcp6       0      0 :::111                  :::*                    LISTEN      1/systemd

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

    tcp6       0      0 ::1:25                  :::*                    LISTEN      1662/master

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

    tcp6       0      0 :::1311                 :::*                    LISTEN      1786/dsm_om_connsvc


 

 Option

 - n: 호스트/포트형식을 IP/숫자로 표시

 - l: Listening 포트 표시

 - t: tcp 포트 표시

 - p: 사용하는 PID/프로그램이름 표시


자세한 내용은  # man netstat 또는 manpage-netstat 링크 참조