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

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

윈도우

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.

 

같은 카테고리의 다른 글
윈도우 11 / 메모장 / 다크 모드 설정하는 방법

윈도우 11 / 메모장 / 다크 모드 설정하는 방법

많은 텍스트 에디터의 기본 테마가 다크 모드이다. 윈도우 11의 메모장도 다크 모드로 변경할 수 있다. 윈도우 11 자체를 다크 모드로 하면 메모장도 다크 모드가 되는데, 윈도우 11 테마는 그대로 둔 채 메모장만 다크 모드로 변경할 수 있다. 메모장을 열고 오른쪽 위의 설정 아이콘을 클릭한다. 앱 테마를 로 설정하면... 어두운 배경에 글자가 밝게 나오는... 다크 모드로 변경된다. 윈도우 ...

윈도우 11 / 창의 그림자 효과 없애는 방법

윈도우 11 / 창의 그림자 효과 없애는 방법

윈도우 11은 윈도우 10에 비하여 디자인이 많이 바뀌었다. 뛰어난 디자이너들이 나름 의미를 부여하면서 작업한 것이겠지만, 아직은 좋은지 잘 모르겠다. 특히 작업표시줄 그룹 해제가 안되는 것은 너무 불편. 바탕화면 기본 이미지가 바뀌어서인지 창의 그림자 효과가 눈에 아주 잘 들어온다. 윈도우 10에서도 있던 것인데, 그림자가 더 진해졌나? 시각적으로 보기 좋게 만든 것이기는 한데, ...

Ubuntu 24.04 Server / 고정 IP 설정하는 방법

네트워크 설정 파일은 /etc/netplan 디렉토리 안에 있는 yaml 파일입니다. 파일 이름은 시스템마다 다를 수 있습니다. # ll /etc/netplan total 12 drwxr-xr-x 2 root root 4096 Apr 27 23:00 ./ drwxr-xr-x 108 root root 4096 Apr 27 23:06 ../ -rw------- 1 root root 389 Apr 27 23:00 50-cloud-init.yaml DHCP라면 설정 파일이 다음과 ...

윈도우 10 / 노트북 덮개 닫아도 절전 모드로 들어가지 않게 하는 방법

윈도우 10 / 노트북 덮개 닫아도 절전 모드로 들어가지 않게 하는 방법

별도의 모니터를 연결해서 쓰는 경우, 원격으로 접속해서 쓰는 경우 등 노트북 덮개를 닫고 사용하는 게 편할 때가 있다. 그런데 보통의 경우 노트북 덮개를 닫으면 절전 모드로 들어간다. 덮개는 노트북을 장시간 사용하지 않을 때 주로 닫기 때문에 그렇게 설정되어 있다. 노트북 덮개를 닫아도 계속 사용하기 위해서는 전원 설정을 변경해주어야 한다. 방법은... 아래는 윈도우 ...

리눅스 / 커널

리눅스 커널은 리눅스 운영체제의 핵심 구성 요소로, 시스템 하드웨어와 소프트웨어 간의 중재자 역할을 합니다. 커널은 시스템 자원을 관리하고, 프로세스 간의 통신을 지원하며, 기본적인 보안과 안정성을 제공합니다. 리눅스 커널은 자유 소프트웨어 및 오픈 소스 소프트웨어 개발 및 배포 모델에 따라 개발됩니다. 리눅스 커널의 주요 기능 프로세스 관리 프로세스 생성 및 종료 : 커널은 새로운 ...

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 / 노트북 덮개 닫아도 절전 모드로 들어가지 않게 하는 방법

윈도우 11에서 노트북 덮개 닫아도 절전 모드로 들어가지 않게 하는 방법 두 가지를 알려드립니다. 윈도우 11 버전에 따라 가능한 방법이 다른데, 방법 1에서 안내하는 메뉴가 없으면 방법 2를 사용하면 됩니다.

윈도우 11 / 초기화 하는 방법

윈도우 11 / 초기화 하는 방법

윈도우 11을 초기화하는 방법은 몇 가지가 있는데, 가장 편한 방법은 윈도우 11에 포함된 복구 기능을 이용하는 것입니다. 설치용 USB를 만들 필요도 없이, 몇 번의 클릭으로 초기화를 할 수 있습니다.

윈도우 10 / 보안 질문 업데이트(변경)하는 방법

윈도우 10 / 보안 질문 업데이트(변경)하는 방법

윈도우에 로그인할 때 마이크로소프트 계정을 사용하지 않습니다. 로컬 계정을 사용합니다. 내 PC가 마이크로소프트와 연동되는 것이 괞히 싫기 때문입니다. 그리고 비밀번호도 만들어 두었습니다. 내 자료를 남이 보는 것도 싫기 때문입니다. 비밀번호를 만들면 항상 신경쓰이는 것이 잊어버린다는 것입니다. 사용자가 비밀번호를 잊을 경우를 대비해서 윈도우 10에서는 보안 질문을 만들게  합니다. 그 질문이나 답이 비밀번호보다 ...

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