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

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

윈도우

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.

 

같은 카테고리의 다른 글
윈도우 10 / Windows.old 폴더 삭제하는 방법

윈도우 10 / Windows.old 폴더 삭제하는 방법

Windows.old 윈도우가 설치된 하드디스크를 보면 Windows.old라는 폴더가 있습니다. 윈도우 8 등 구버전에서 업그레이드 할 때, 윈도우 10을 업데이트할 때 만들어지는 폴더입니다. 구버전의 프로그램 정보를 담고 있는 폴더로, 현재 상태에 문제가 없어서 구버전으로 돌아갈 필요가 없다면, 필요 없는 폴더입니다. 만약 하드디스크의 용량이 부족하다면 Windows.old 폴더를 삭제해서 사용 가능한 디스크 용량을 늘릴 수 있습니다. Windows.old 폴더 ...

윈도우 10 / 가상 데스크톱 단축키와 타임라인 해제하는 방법

윈도우 10 / 가상 데스크톱 단축키와 타임라인 해제하는 방법

가상 데스크톱 단축키 윈도우 10에는 가상 데스크톱 기능이 있습니다. 창을 많이 띄워야 하는 작업을 할 때, 남에게 보이고 싶지 않은 작업을 할 때 유용한 기능입니다. 가상 데스크톱을 관리하는 것은 단축키로 하는 것이 편합니다. 그래야 가상 데스크톱 사이의 전환을 빠르게 할 수 있어 효율적인 작업이 가능합니다. 주요 단축키는 다음과 같습니다. 가상 데스크톱 만들기 : Ctrl ...

윈도우 11 / 디스크 관리 / 디스크 추가하는 방법, 볼륨 만드는 방법, 볼륨 변경하는 방법

윈도우 11 / 디스크 관리 / 디스크 추가하는 방법, 볼륨 만드는 방법, 볼륨 변경하는 방법

PC에 저장 공간이 부족하면 디스크를 추가한다. 외장 하드를 이용하는 방법도 있지만, 메인보드에 디스크를 붙이는 것이 좀 더 안정적이고 속도가 빠르다. 요즘 출시된 노트북은 디스크를 추가할 수 있는 여유 공간이 제공되는 것이 많아, 가벼운 SSD를 추가하면 저장 공간이 작다는 노트북의 단점이 사라진다. 디스크를 추가하면 몇 가지 작업이 필요한데, 윈도우 11에서 어떻게 하는지 ...

CentOS 7 / firewall-cmd 명령어로 방화벽 관리하기

CentOS 7 / firewall-cmd 명령어로 방화벽 관리하기

CentOS의 방화벽 관리 데몬은 firewalld입니다. 설정은 firewall-cmd 명령어로 합니다. 방화벽 실행 여부 확인 firewall-cmd --state 실행 중이면 running, 실행 중이 아니면 not running을 출력합니다. 방화벽 다시 로드 firewall-cmd --reload 방화벽 설정 후 다시 로드해야 적용됩니다. 존(Zone) 출력하기 firewall-cmd --get-zones 존(zone) 목록을 출력합니다. firewall-cmd --get-default-zone 기본 존을 출력합니다. firewall-cmd --get-active-zones 활성화된 존을 출력합니다. 사용 가능한 서비스/포트 출력하기 firewall-cmd --list-all 사용 가능한 모든 서비스/포트 목록을 출력합니다. firewall-cmd --zone=public --list-all public 존에 ...

Ubuntu 16.04 / phpMyAdmin / 특정 IP에서만 접속 가능하게 만드는 방법

우분투 16.04에서 phpMyAdmin을 패키지로 설치했을 때, 기본 설정은 모든 IP에서 접속 가능입니다. 만약 특정 IP에서만 접속 가능하게 하려면 /etc/apache2/conf-available/phpmyadmin.conf에 다음 코드를 추가합니다. <Directory /usr/share/phpmyadmin> Order deny,allow Deny from all Allow from xxx.xxx.xxx.xxx </Directory> xxx.xxx.xxx.xxx는 접속하려는 IP로 바꿉니다. 여러 IP를 설정하고 싶을 때는 띄어쓰기로 구분합니다. <Directory /usr/share/phpmyadmin> Order deny,allow Deny from all ...

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

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

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

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

Ubuntu 20.04 Server / Samba / 설치하고 공유 폴더 만드는 방법

Ubuntu 20.04 Server / Samba / 설치하고 공유 폴더 만드는 방법

Samba를 이용하여 Ubuntu Server에 공유 폴더를 만들고, Windows 클라이언트에서 접속하는 방법을 알아본다. Samba 설치 Samba를 설치한다. 설치하면 바로 시작하고, 재부팅을 해도 자동으로 시작한다. apt install samba 공유할 폴더를 만들고 권한을 777로 설정한다. mkdir /sharedfolder chmod 777 /sharedfolder 설정 파일은 /etc/samba/smb.conf이다. 텍스트 에디터로 열고 제일 밑에 다음 코드를 추가한다. 폴더 이름은 sharedfolder이지만, 네트워크에서는 Shared Folder로 보인다. comment = ...

윈도우 10 / 방화벽 해제하는 방법

윈도우 10 / 방화벽 해제하는 방법

방화벽은 네트워크 간에 주고 받는 트래픽을 허용 또는 차단한다. Windows 10에도 기본적으로 방확벽이 있다. 그리고 활성화되어 있다. 특별한 이유가 없는 한 방화벽은 켜는 것이 좋다. 허용 또는 차단할 포트가 있다면 개별적으로 설정하는 것이 좋다. 만약 어떤 이유로 인해 방화벽 자체를 꺼야 한다면, 즉 모든 트래픽을 허용해야 한다면, 다음 두 가지 방법으로 할 ...

윈도우 11 / PowerToys / 사용법 / Shortcut Guide

윈도우 11 / PowerToys / 사용법 / Shortcut Guide

PowerToys의 Shortcut Guide는 윈도우 단축키를 오버레이로 보여준다. 단축키는 이다. 단축키를 누르면 아래처럼 단축키 목록이 나오고, Esc를 누르면 사라진다.