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

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

윈도우

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 / 폴더 아이콘 변경하는 방법

윈도우의 폴더 아이콘은 사용자가 파일과 하위 폴더를 쉽게 식별하고 접근할 수 있도록 시각적으로 나타내는 그래픽 이미지입니다. 기본적으로 윈도우 운영체제는 폴더를 노란색의 서류철 모양으로 표현하지만, 사용자가 원하는 이미지를 설정해 변경할 수 있습니다. 폴더 아이콘의 주요 기능은 다음과 같습니다: 시각적 식별: 여러 폴더가 있을 때 각 폴더의 아이콘이 다르면 쉽게 구분할 수 있어 파일 ...

리눅스 / 명령어 / man / 명령어의 설명서 출력하는 명령어

man은 manual의 약어로, 명령어의 설명서를 출력하는 명령어이다. man 뒤에 명령어 이름을 넣고 엔터를 누릅니다. 예를 들어 # man rm 은 rm 명령어의 설명서를 출력한다. ↑ 키를 누르면 한 줄 위로 올라가고, ↓ 키를 누르면 한 줄 아래로 내려간다. Page Up 키를 누르면 한 페이지 위로 올라가고, Page Down 키를 누르면 한 페이지 아래로 내려간다. /를 ...

윈도우 11 / BitLocker로 드라이브 암호화하는 방법

윈도우 11 / BitLocker로 드라이브 암호화하는 방법

BitLocker는 Microsoft Windows 운영 체제에 포함된 드라이브 암호화 기능으로, 전체 디스크 볼륨을 암호화하여 데이터의 무단 액세스를 방지하는 도구입니다. 노트북이나 이동식 저장 장치와 같은 장치를 도난당하거나 분실했을 때, 데이터가 무단으로 접근되는 것을 방지합니다. 윈도우 11에서 BitLocker를 켜는 방법, BitLocker를 해제하는 방법에 대하여 알아봅니다. BitLocker 켜는 방법 암호화하려는 드라이브를 선택하고, 마우스 우클릭합니다. 를 클릭합니다. 잠금 해제할 ...

윈도우 10 / PC용 구글 드라이브 설치하는 방법

윈도우 10 / PC용 구글 드라이브 설치하는 방법

PC용 구글 드라이브를 설치하면, PC의 파일을 구글 드라이브에, 구글 드라이브의 파일을 PC에 동기화(백업) 할 수 있습니다. 내 개인 자료가 클라우드에 있는 것이 싫어서 PC의 파일을 구글 드라이브에 올리지는 않지만, 구글 드라이브에 있는 자료를 내 PC로 옮길 때는 PC용 구글 드라이브가 편합니다. 스마트폰으로 찍은 사진을 구글 포토에 백업하고 있다면, 구글 포토에서 구글 ...

Ubuntu 22.04 Server / 백신 프로그램 ClamAV 설치 및 사용법

ClamAV ClamAV는 리눅스에서 사용할 수 있는 백신 프로그램이다. 우분투 패키지에 포함되어 있으므로 apt 명령으로 쉽게 설치하고 사용할 수 있다. 설치 # apt install clamav 사용법 데이터베이스 업데이트 clamav-freshclam 서비스를 중지한다. # systemctl stop clamav-freshclam freshclam 명령으로 업데이트한다. # freshclam clamav-freshclam 서비스를 시작한다. # systemctl start clamav-freshclam 검사 home 디렉토리와 그 하위 디렉토리를 검사한다. # clamscan -r /home 검사 결과는 다음처럼 나온다. ----------- SCAN SUMMARY ----------- Known viruses: ...

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

리눅스 / 명령어 / mkdir / 디렉토리 만드는 명령어

mkdir은 make directory의 약자로, 디렉토리를 만드는 명령어이다. abc 디렉토리를 만든다. # mkdir abc abc 디렉토리 아래에 def 디렉토리를 만든다. 만약 abc 디렉토리가 없다면 def 디렉토리를 만들 수 없다는 메시지가 나온다. # mkdir abc/def p 옵션을 붙이면 abc 디렉토리가 없어도 abc 디렉토리를 만든 후에 def 디렉토리를 만든다. # mkdir -p abc/def 리눅스 / 명령어 / rm / 파일 ...

윈도우 10 / 터치 키보드(가상 키보드, 화면 키보드) 사용하는 방법

윈도우 10 / 터치 키보드(가상 키보드, 화면 키보드) 사용하는 방법

갑자기 키보드가 망가졌습니다. 그런데 급하게 메일을 보내야합니다. 그렇다면 터치 키보드를 사용하세요. 원래는 터치가 되는 모니터를 위한 기능인데, 마우스로도 가능합니다. 작업 표시줄에 마우스를 올리고 우클릭합니다. 를 클릭합니다. 글자를 입력해야하는 프로그램을 실행하고, 오른쪽 아래에 있는 키보드 아이콘을 클릭하면... 화면에 키보드가 만들어집니다. 이제 마우스로 자판을 클릭해서 글자를 입력할 수 있습니다. 키보드 설정 아이콘을 클릭해서... 키보드 모양을 ...

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

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

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