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

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

윈도우

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 / 프린트 스크린 키 눌렀을 때 캡처 도구 실행되지 않게 하는 방법

윈도우에는 캡처 도구가 설치되어 있다. 그런데 컴퓨터 화면 캡처는 주로 픽픽을 사용한다. 여러 방식의 캡처가 가능하고, 단축키 사용도 편하고, 무엇보다 손에 익었다. 픽픽으로 캡처를 할 때 전체 화면 캡처의 단축키는 프린트 스크린(Print Screen)인데, 윈도우를 새로 설치하고 픽픽을 설치했더니 프린트 스크린 키를 눌렀을 때 픽픽으로 캡처하지 않고 캡처 도구가 뜬다. 이게 너무 불편하여 ...

윈도우 11 / 바탕화면 배경 변경하는 방법

윈도우 11 / 바탕화면 배경 변경하는 방법

윈도우 11에서 배경화면 변경하는 방법은 다음과 같다. 바탕화면에서 마우스 우클릭하고 을 클릭하거나... 을 클릭한다.(윈도우 11 / 설정을 여는 세 가지 방법) 을 클릭하고... 사진, 단색, 슬라이드 쇼, Windows 추천에서 선택한다. 모니터와 다른 해상도의 사진이라면 어떻게 조정할지를 정한다.

Ubuntu 16.04 Server / PHP / 메모리 늘리는 방법

PHP 설정은 php.ini에서 한다. Ubuntu 16.04에서 php.ini의 위치는 /etc/php/7.0/apache2/php.ini 이다. PHP 버전에 따라 7.0은 다른 숫자일 수 있다. 메모리를 늘리기 위해 수정해야 할 것은 memory_limit이다. 기본값은 128M이다. 128을 적절히 변경한다. memory_limit = 128M 변경한 설정이 적용되도록 하려면 웹서버를 다시 시작하거나 다시 로드한다. Apache 웹서버라면 다음과 같이 명령하여 다시 시작할 수 있고, # service apache2 restart 다음과 같이 ...

윈도우 11 / 이모지(Emoji) 사용하는 방법

윈도우 11 / 이모지(Emoji) 사용하는 방법

이모지(Emoji)는 감정, 사물, 동작, 장소, 기호 등을 그림이나 아이콘으로 나타내는 문자입니다. 😃😂❤️✨ 같은 그림들이 바로 이모지입니다. 윈도우 11에서 이모지를 사용하는 방법은 다음과 같습니다.

CentOS 7 / mod_security 설치하는 방법

CentOS 7 / mod_security 설치하는 방법

mod_security는 아파치 웹서버에 사용할 수 있는 방화벽 모듈입니다. ModSecurity is an open source, cross-platform web application firewall (WAF) module. Known as the "Swiss Army Knife" of WAFs, it enables web application defenders to gain visibility into HTTP(S) traffic and provides a power rules language and API to implement advanced protections. 설치 yum install ...

윈도우 10 / 저장소 공간, 저장소 풀

윈도우 10 / 저장소 공간, 저장소 풀

여러 개의 하드디스크를 하나처럼 사용하고 싶을 때, 일부 하드 디스크가 고장나도 데이터 손상이 없도록 만들고 싶을 때, 저장소 풀을 사용해보세요. 간단한 조작으로 하드 디스크의 활용도를 높일 수 있습니다. 저장소 풀 만들기 Windows 설정을 엽니다.(단축키 WIN+I) 을 클릭합니다. 왼쪽 메뉴에서 를 클릭합니다. 를 클릭합니다. 를 클릭합니다. 저장소 풀에 포함할 하드디스크를 선택하고 ...

윈도우 11 / PowerToys / 설치

윈도우 11 / PowerToys / 설치

PowerToys는 Microsoft가 제공하는 유용한 유틸리티 모음이다. 현재 구성은 다음과 같다. Always On PowerToys Awake Color Picker FancyZones File Explorer Add-ons Image Resizer Keyboard Manager Mouse utilities PowerRename PowerToys Run Shortcut Guide Video Conference Mute 설치는 두 가지 방식으로 할 수 있다. GitHub에서 다운로드하여 설치하기 https://github.com/microsoft/PowerToys에 접속한 후 최신 릴리즈를 클릭한다. PC나 노트북이라면 보통 PowerToysSetup-0.6.1.1-x64.exe를 다운로드하면 된다. 다운로드한 파일을 실행하여 설치한다. 설치 후 실행하면 포함된 기능을 볼 수 있고, ...

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 ...

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

윈도우 / ADMIN$, C$ 제거하는 방법, 복원하는 방법

윈도우 / ADMIN$, C$ 제거하는 방법, 복원하는 방법

윈도우에는 기본적으로 공유되는 폴더가 있다. ADMIN$, C$, IPC$인데, 보안 등 여러 가지 이유로 공유를 중지해야 할 때가 있다. 공유를 중지하는 방법에 대하여 알아본다. 공유 폴더 확인 하기 방법 1 에서 확인할 수 있다. 방법 2 CMD 창을 실행 후 다음과 같이 명령하면 공유 폴더 목록이 나온다. net ...