다른 서버나 컴퓨터의 포트가 열렸는지 확인하는 방법

다른 서버의 특정 포트가 열려 있는지 알아야 할 때가 있습니다. 윈도우와 리눅스에서 확인하는 방법을 정리합니다.

윈도우

telnet 명령어 이용하는 방법

  • 텔넷 클라이언트 기능을 추가합니다.
  • 명령 프롬프트(CMD) 또는 PowerShell에서 다음과 같이 명령합니다. google.com의 443 포트가 열렸는지 확인하는 것입니다.
C:\Users\JB>telnet google.com 443
  • 포트가 열려 있다면 아무 내용 없는 창이 나옵니다.
  • 만약 닫혀 있다면 아래와 같이 연결하지 못한다는 메시지가 나옵니다.
C:\Users\JB>telnet google.com 444
연결 대상 google.com...호스트에 연결할 수 없습니다. 포트 444: 연결하지 못했습니다.

tnc 명령어 이용하는 방법

  • PowerShell에서 다음과 같이 명령합니다. google.com의 443 포트가 열렸는지 확인하는 것입니다.
  • 열려 있다면 True...
PS C:\Users\JB> tnc google.com -port 443

ComputerName     : google.com
RemoteAddress    : 142.250.76.142
RemotePort       : 443
InterfaceAlias   : Ethernet
SourceAddress    : 192.168.0.201
TcpTestSucceeded : True
  • 그렇지 않다면 False를 반환합니다.
PS C:\Users\JB> tnc google.com -port 444
경고: TCP connect to (142.250.76.142 : 444) failed

ComputerName           : google.com
RemoteAddress          : 142.250.76.142
RemotePort             : 444
InterfaceAlias         : Ethernet
SourceAddress          : 192.168.0.201
PingSucceeded          : True
PingReplyDetails (RTT) : 34 ms
TcpTestSucceeded       : False

Test-NetConnection 명령어 이용하는 방법

  • PowerShell에서 다음과 같이 명령합니다. google.com의 443 포트가 열렸는지 확인하는 것입니다.
PS C:\Users\jb> Test-NetConnection -ComputerName google.com -Port 443                                                                                                                                                                                                                                                                                                   ComputerName     : google.com
RemoteAddress    : 142.250.207.110
RemotePort       : 443
InterfaceAlias   : Ethernet
SourceAddress    : 192.168.0.200
TcpTestSucceeded : True

리눅스

  • nc 명령어로 확인할 수 있습니다.
# nc -zv google.com 443
Ncat: Version 7.70 ( https://nmap.org/ncat )
Ncat: Connected to 142.250.206.206:443.
Ncat: 0 bytes sent, 0 bytes received in 0.05 seconds.

 

같은 카테고리의 다른 글

리눅스 / 명령어 / which, whereis, locate / 명령어 위치 찾기

명령어의 위치를 찾을 때 사용할 수 있는 명령어에는 which, whereis, locate가 있다. 명령어의 위치만 찾을 때는 which를 사용하고, 관련된 파일들의 위치까지 찾을 때는 whereis나 locate를 사용한다. which 명령어로 find 명령어를 찾는다. # which find /usr/bin/find whereis 명령어로 find 명령어를 찾는다. # whereis find find: /usr/bin/find /usr/share/man/man1/find.1.gz locate 명령어로 find 명령어를 찾는다. # locate find /usr/bin/find /usr/bin/find2perl /usr/bin/findmnt /usr/bin/nl-link-ifindex2name /usr/bin/nl-link-name2ifindex /usr/bin/oldfind /usr/lib64/python2.7/modulefinder.py /usr/lib64/python2.7/modulefinder.pyc /usr/lib64/python2.7/modulefinder.pyo /usr/sbin/btrfs-find-root /usr/sbin/findfs /usr/share/bash-completion/completions/findmnt /usr/share/doc/findutils-4.5.11 /usr/share/doc/findutils-4.5.11/AUTHORS /usr/share/doc/findutils-4.5.11/COPYING /usr/share/doc/findutils-4.5.11/ChangeLog /usr/share/doc/findutils-4.5.11/NEWS /usr/share/doc/findutils-4.5.11/README /usr/share/doc/findutils-4.5.11/THANKS /usr/share/doc/findutils-4.5.11/TODO /usr/share/doc/wpa_supplicant-2.6/examples/p2p/p2p_find.py /usr/share/doc/wpa_supplicant-2.6/examples/p2p/p2p_stop_find.py /usr/share/info/find-maint.info.gz /usr/share/info/find.info.gz /usr/share/locale/be/LC_MESSAGES/findutils.mo /usr/share/locale/bg/LC_MESSAGES/findutils.mo /usr/share/locale/ca/LC_MESSAGES/findutils.mo /usr/share/locale/cs/LC_MESSAGES/findutils.mo /usr/share/locale/da/LC_MESSAGES/findutils.mo /usr/share/locale/de/LC_MESSAGES/findutils.mo /usr/share/locale/el/LC_MESSAGES/findutils.mo /usr/share/locale/eo/LC_MESSAGES/findutils.mo /usr/share/locale/es/LC_MESSAGES/findutils.mo /usr/share/locale/et/LC_MESSAGES/findutils.mo /usr/share/locale/fi/LC_MESSAGES/findutils.mo /usr/share/locale/fr/LC_MESSAGES/findutils.mo /usr/share/locale/ga/LC_MESSAGES/findutils.mo /usr/share/locale/gl/LC_MESSAGES/findutils.mo /usr/share/locale/hr/LC_MESSAGES/findutils.mo /usr/share/locale/hu/LC_MESSAGES/findutils.mo /usr/share/locale/id/LC_MESSAGES/findutils.mo /usr/share/locale/it/LC_MESSAGES/findutils.mo /usr/share/locale/ja/LC_MESSAGES/findutils.mo /usr/share/locale/ko/LC_MESSAGES/findutils.mo /usr/share/locale/lg/LC_MESSAGES/findutils.mo /usr/share/locale/lt/LC_MESSAGES/findutils.mo /usr/share/locale/ms/LC_MESSAGES/findutils.mo /usr/share/locale/nl/LC_MESSAGES/findutils.mo /usr/share/locale/pl/LC_MESSAGES/findutils.mo /usr/share/locale/pt/LC_MESSAGES/findutils.mo /usr/share/locale/pt_BR/LC_MESSAGES/findutils.mo /usr/share/locale/ro/LC_MESSAGES/findutils.mo /usr/share/locale/ru/LC_MESSAGES/findutils.mo /usr/share/locale/rw/LC_MESSAGES/findutils.mo /usr/share/locale/sk/LC_MESSAGES/findutils.mo /usr/share/locale/sl/LC_MESSAGES/findutils.mo /usr/share/locale/sr/LC_MESSAGES/findutils.mo /usr/share/locale/sv/LC_MESSAGES/findutils.mo /usr/share/locale/tr/LC_MESSAGES/findutils.mo /usr/share/locale/uk/LC_MESSAGES/findutils.mo /usr/share/locale/vi/LC_MESSAGES/findutils.mo /usr/share/locale/zh_CN/LC_MESSAGES/findutils.mo /usr/share/locale/zh_TW/LC_MESSAGES/findutils.mo /usr/share/man/man1/find.1.gz /usr/share/man/man1/find2perl.1.gz /usr/share/man/man1/oldfind.1.gz /usr/share/man/man8/btrfs-find-root.8.gz /usr/share/man/man8/findfs.8.gz /usr/share/man/man8/findmnt.8.gz locate 명령어는 -n 옵션으로 출력 ...

윈도우 11 / LTSC(Long-Term Servicing Channel)

윈도우 11 / LTSC(Long-Term Servicing Channel)

Windows 11 LTSC는 장기 서비스 채널(Long-Term Servicing Channel)이라는 이름처럼, 장기간 안정적인 운영을 목표로 한 특별한 윈도우 11 버전입니다. 일반적으로 사용하는 Windows 11 Home, Pro와는 다소 다른 성격을 가지고 있습니다. Windows 11 LTSC는 2024년 10월 1일에 출시되었습니다.

CentOS 7 / Let’s Encrypt에서 무료 SSL 인증서 발급 받는 방법

CentOS 7 / Let’s Encrypt에서 무료 SSL 인증서 발급 받는 방법

CentOS 7에서 Let’s Encrypt 인증서를 발급 받는 방법을 요약합니다. 환경 CentOS 7 Apache Web Server 설치 저장소 추가 yum install epel-release 설치 yum install python-certbot-apache 인증서 발급 abc.com 인증서 발급 certbot --apache -d abc.com abc.com과 www.abc.com 인증서 동시 발급 certbot --apache -d abc.com -d www.abc.com 인증서 갱신 Let’s Encrypt 인증서는 90일마다 갱신해야 합니다. certbot renew

윈도우 10 / 설정을 여는 세 가지 방법

윈도우 10 / 설정을 여는 세 가지 방법

윈도우의 여러 설정이 으로 옮겨지고 있다. 이제는 제어판보다 설정을 더 많이 사용하는 거 같다. 윈도우 설정을 여는 세 가지 방법을 소개한다. 윈도우 10 / 제어판을 여는 세 가지 방법, 바탕화면에 추가하는 방법 방법 1 가장 기억하기 쉬운 방법이다. 그러나 메뉴를 찾기 위해 스크롤을 해야 한다. 시작 버튼을 클릭하여 시작 메뉴를 연다. 을 클릭한다. 시작 화면에 고정하거나 ...

CentOS 8 / DNF 사용법

CentOS 8 / DNF 사용법

DNF는 CentOS 8에 추가된 패키지 관리 명령어입니다. YUM과 사용법이 비슷합니다. 도움말 보기 dnf -h 패키지 목록 보기 dnf list 그룹 목록 보기 dnf grouplist zip 관련 패키지 검색 dnf search zip zip 패키지 정보 출력 dnf info zip Server with GUI 그룹 정보 출력 dnf groupinfo 'Server with GUI' zip 패키지 설치 dnf install zip zip 패키지 삭제 dnf remove zip httpd와 php 설치 dnf install httpd php Server ...

윈도우 11 / 가상 데스크톱과 작업 보기

윈도우 11 / 가상 데스크톱과 작업 보기

컴퓨터는 멀티태스킹을 지원한다. 동시에 여러 가지 프로그램을 띄워 놓고 작업하는 것이 가능하다. 요즘은 너무나 당연한 것이지만, 아주 예전에는 한 번에 하나의 프로그램만 실행할 수 있었다. 멀티태스킹의 단점은 너무 많은 프로그램을 실행했을 때 프로그램 간 전환이 불편하다는 것이다. 이럴 때 유용한 것이 가상 데스크톱이다. 1번 데스크톱에는 파워포인트와 엑셀, 2번 데스크톱에는 포토샵과 일러스트레이터와 ...

윈도우 / 로그온 시도나 암호 변경 시도를 너무 많이 했기 때문에 보안을 위해 사용자 계정이 잠겼습니다

윈도우 / 로그온 시도나 암호 변경 시도를 너무 많이 했기 때문에 보안을 위해 사용자 계정이 잠겼습니다

집에서 사무실 컴퓨터에 원격 데스크톱으로 접속하여 작업할 때가 있다. 오랫동안 잘 사용했는데, 최근 들어 아래와 같은 메시지가 나오면서 연결이 되지 않을 때가 있다. 로그온 시도나 암호 변경 시도를 너무 많이 했기 때문에 보안을 위해 사용자 계정이 잠겼습니다. 잠시 기다렸다가 다시 시도하거나 시스템 관리자나 기술 지원 서비스에 문의하십시오. 로그온 실패가 많아서 계정을 잠가버린 ...

윈도우 11 / PowerShell / PowerShell 7 설치하는 방법

윈도우 11 / PowerShell / PowerShell 7 설치하는 방법

윈도우 11에 Windows 터미널이라는 것이 생겼다. 시작 메뉴에도 있고, 파일 탐색기에서 마우스 우클릭해도 있다. 내가 원하는 위치에서 터미널을 쉽게 열 수 있다는 게 장점. 기본 터미널로 PowerShell이 설정되어 있는데, 언제부턴가 최신 PowerShell을 설치해보라는 메시지가 뜬다. 특별히 불편한 점은 없지만, 그 메시지가 보기 싫어서 업그레이드를 해보았다.(정확히는 업그레이드가 아니라 새로운 PowerShell을 설치하는 것.) URL을 ...

윈도우 10 / 터치 패드 끄는 방법

윈도우 10 / 터치 패드 끄는 방법

노트북에 키보드와 마우스를 연결하고 사용할 때, 터치 패드가 작동하면 불편할 수 있다. 노트북에서 펑션 키를 제공하면 그 키로 비활성화하면 되고, 그렇지 않다면 설정에서 끌 수 있다. 설정을 연다.(단축키는 WIN+I) 를 클릭한다. 왼쪽에서 를 클릭하고, 오른쪽에서 설정한다. 터치 패드 밑에 있는 토글 버튼으로 켜거나 끌 수 있다. 켠 상태에서 의 ...

윈도우 10 / 시작프로그램 / 사용, 사용 안 함 설정하는 방법

윈도우 10 / 시작프로그램 / 사용, 사용 안 함 설정하는 방법

방법 1 작업표시줄에 마우스를 올리고 우클릭합니다. 를 클릭합니다. 을 클릭합니다. 사용하지 않는 것을 선택 후 을 클릭하거나... 사용하는 것을 선택하고 을 클릭합니다. 방법 2 Windows 설정을 엽니다.(단축키 Win+I) 을 클릭합니다. 을 클릭합니다. 사용하고 싶은 것은 켜고, 사용하지 않을 것은 끕니다.