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

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

윈도우

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.

 

같은 카테고리의 다른 글

리눅스 / 명령어 / cp - 복사하는 명령어, mv - 이동하는 명령어

cp는 copy의 약자로 복사하는 명령어, mv는 move의 약자로 이동하는 명령어이다. 복사하기 abc.txt 파일을 def.txt로 이름을 바꾸어 복사한다. cp abc.txt def.txt xyz라는 디렉토리가 없다면 abc.txt 파일을 xyz 파일로 복사한다. xyz라는 디렉토리가 있다면 xyz 디렉토리 안에 abc.txt 파일을 복사한다. cp abc.txt xyz abc.txt 파일을 xyz 디렉토리 안에 def.txt라는 이름으로 복사한다. cp abc.txt xyz/def.txt abc가 디렉토리이고 xyz라는 디렉토리가 없다면, abc 디렉토리를 xyz로 ...

윈도우 10 / 다중 모니터 사용시 메인 모니터에만 작업 표시줄 나오게 설정하는 방법

윈도우 10 / 다중 모니터 사용시 메인 모니터에만 작업 표시줄 나오게 설정하는 방법

컴퓨터 작업을 할 때 모니터를 여러 대 사용하는 게 유행입니다. 특히 노트북을 사용할 때는 화면이 작아서 큰 모니터를 연결해서 사용하는 경우가 많습니다. 윈도우의 디스플레이 확장 기능으로 여러 모니터를 사용하면, 각 화면마다 작업 표시줄이 나옵니다. 어떻게 보면 편한 기능이고, 어떻게 보면 불편한 기능입니다. 만약 모든 모니터에 작업 표시줄이 나오는 게 불편하다면, 설정에서 ...

윈도우 10 / 마이크로소프트 계정으로 윈도우에 로그인하는 방법

윈도우 10 / 마이크로소프트 계정으로 윈도우에 로그인하는 방법

윈도우 10에 로그인하는 방법은 두 가지가 있습니다. 하나는 로컬 계정으로 로그인하는 것이고, 다른 하나는 마이크로소프트 계정으로 로그인하는 것입니다. 마이크로소프트 계정으로 로그인하는 것은, 안드로이드 스마트폰에 구글 계정으로 로그인하는 거 또는 아이패드에 애플 계정으로 로그인하는 것과 비슷하다고 보면 됩니다. 윈도우에 마이크로소프트 계정으로 로그인하는 것은 여러 가지 장점이 있겠지만, 내 PC의 정보를 마이크로소프트와 공유한다는 ...

윈도우 / Hyper-V / 가상 머신 1세대와 2세대 차이

윈도우 / Hyper-V / 가상 머신 1세대와 2세대 차이

Hyper-V에서 가상 컴퓨터를 만들 때 1세대와 2세대애서 선택하게 되어 있습니다. 1세대(Generation 1)와 2세대(Generation 2)는 가상 머신의 펌웨어 및 부트 방식, 하드웨어 기능 지원 방식에 차이가 있습니다.

윈도우 10 / IP 확인하는 방법

윈도우 10 / IP 확인하는 방법

IP는 두 가지로 구분할 수 있습니다. 내 컴퓨터에 할당된 IP 외부와 통신하는 IP 보통 인터넷 공유기나 방화벽을 통하여 통신하므로, 내 컴퓨터에 할당된 IP와 외부와 통신하는 IP는 다릅니다. 예를 들어 다음과 같이 구성되어 있다면... 공유기의 IP가 외부와 통신하는 IP, 공유기가 컴퓨터에 할당한 IP가 내 컴퓨터에 할당된 IP입니다. 윈도우 10에서 두 가지 IP를 확인하는 방법을 알아봅니다. 내 컴퓨터에 ...

리눅스 / 명령어 / 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 옵션으로 출력 ...

윈도우 10 / Microsoft 사진 / 초기화 또는 복구하는 방법

윈도우 10 / Microsoft 사진 / 초기화 또는 복구하는 방법

윈도우 10에 포함된 사진 앱은, 이름은 사진이지만 동영상 편집까지 가능한 유용한 앱입니다. 그런데, 이상하게 가끔 문제가 생깁니다. 실행이 되지 않거나, 오류가 생기거나... 그런 경우 프로그램을 삭제 후 다시 설치하면 보통 해결이 되는데, 사진 앱은 제거가 되지 않습니다. 대신 초기화 또는 복구는 가능합니다. Windows 설정을 엽니다. 단축키는 WIN+I입니다. 을 클릭합니다. 는 활성화되지 ...

윈도우 11 / 안전 모드로 부팅하는 방법

윈도우 11 / 안전 모드로 부팅하는 방법

윈도우에서 안전 모드로 부팅하는 이유는 시스템 문제를 해결하거나 진단하기 위해서입니다. 안전 모드는 필수적인 드라이버와 서비스만 로드하여 최소한의 환경으로 윈도우를 실행하므로, 일반적인 부팅 과정에서 발생할 수 있는 충돌이나 문제를 피할 수 있습니다. 윈도우 11에서 안전 모드로 부팅하는 방법은 다음과 같습니다. 윈도우 설정을 엽니다. 단축키는 WIN+I입니다. 로 이동합니다. 복구 옵션의 고급 시작 옵션에 있는 ...

윈도우 10 / 부팅, 다시 시작할 때 종료하지 않았던 앱 열리지 않게 하는 방법

윈도우 10 / 부팅, 다시 시작할 때 종료하지 않았던 앱 열리지 않게 하는 방법

컴퓨터를 켜거나 재부팅할 때 종료하지 않은 앱이 시작되는 경우가 있습니다. 예를 들어 크롬을 열고 인터넷 서핑을 하다가 재부팅을 하면 크롬이 자동으로 실행되는 것이죠. 이 기능은 상황에 따라 좋기도 하고 나쁘기도 합니다. 내가 어떤 프로그램으로 무엇을 했는지 알리고 싶지 않다면 나쁜 기능이 되는 거죠. 딱히 뭐라고 이름을 붙이기 힘든 이 기능을 켜거나 끄는 ...

윈도우 10 / 마우스 / 왼손잡이 설정하는 방법

윈도우 10 / 마우스 / 왼손잡이 설정하는 방법

일반적으로 마우스에는 단추가 두 개 있습니다. 왼쪽 버튼을 누르면 선택을 하거나 끌기를 할 수 있고, 오른쪽 버튼을 누르면 팝업 메뉴가 나옵니다. 오른손 잡이에게는 이 설정이 편한데, 왼손 잡이에게는 불편할 수 있습니다. 만약 마우스를 왼손으로 사용한다면 좌우 버튼의 기능을 바꾸어서 사용하면 됩니다. 윈도우 설정에서 변경 가능합니다. Windows 설정을 엽니다. 단축키는 [WIN + ...