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

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

윈도우

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 / 디스크 100% 해결하는 방법

윈도우 11 / 디스크 100% 해결하는 방법

윈도우 11에서 디스크 사용률이 100%에 도달하는 문제는 시스템 성능을 저하시킬 수 있습니다. 이 문제를 해결하기 위해 다음 단계를 시도해 볼 수 있습니다. Windows Search 서비스 비활성화 Windows Search 서비스가 디스크 사용률을 높일 수 있습니다. Windows 키 + R을 눌러 실행 창을 엽니다. services.msc를 입력하고 Enter를 누릅니다. Windows Search를 찾은 후 더블 클릭합니다. 시작 유형을 사용 안 ...

Ubuntu 18.04 Server / Nginx, PHP, MariaDB 설치하고 설정하기

Ubuntu 18.04 Server / Nginx, PHP, MariaDB 설치하고 설정하기

Nginx 설치 Nginx를 설치합니다. # apt install nginx 만약 방화벽을 사용하고 있다면 포트를 열어줍니다. # ufw allow 'Nginx Full' 서버 주소로 접속했을 때 다음과 같이 나오면 제대로 된 것입니다. 시작, 정지 등 Nginx를 시작합니다. # systemctl start nginx Nginx를 멈춥니다. # systemctl stop nginx Nginx를 재시작합니다. # systemctl restart nginx Nginx를 다시 로드합니다. # systemctl reload nginx Nginx를 설치하면 부팅 시 자동으로 시작하게 설정됩니다. 만약 자동 ...

윈도우 10 / 랜카드 두 개 동시에 사용하는 방법

윈도우 10 / 랜카드 두 개 동시에 사용하는 방법

노트북을 사용하면 보통 무선과 유선, 두 개의 랜카드가 있다. 둘 중에 하나만 사용하는 게 대부분이겠지만, 어떤 경우에는 둘 다 사용해야 하는 경우도 있다. 그런데 윈도우 10 또는 윈도우 11을 사용하면 둘 중 하나만 네트워크에 연결한다. 하나가 연결되면 다른 하나의 연결을 끊는데, 유선을 우선으로 하는 거 같다. 즉, 무선이 연결된 상태에서 유선을 ...

CentOS 7 / Samba / 설치하고 공유 폴더 만드는 방법

CentOS 7 / Samba / 설치하고 공유 폴더 만드는 방법

Samba 설치 Samba 패키지 이름은 samba입니다. yum install samba 방화벽 설정 Samba가 사용하는 포트를 열어줍니다. firewall-cmd --permanent --zone=public --add-service=samba 방화벽을 다시 로드합니다. firewall-cmd --reload 참고 : CentOS 7 / firewall-cmd 명령어로 방화벽 관리하기 SELinux SELinux를 적절히 설정하거나 끕니다. 참고 : CentOS 7 / SELinux 끄는 방법 Samba 사용자 추가 사용자가 Samba를 사용할 수 있도록 해줍니다. 만약 사용자계정이 user1이라면 다음과 같이 합니다. smbpasswd -a user1 Samba 설정 Samba 설정 ...

윈도우 11 / 원격 데스크톱 / 연결 허용하는 방법

윈도우 11 / 원격 데스크톱 / 연결 허용하는 방법

원격으로 다른 컴퓨터에 들어가는 방법은 여러 가지가 있습니다. 그 중 가장 간단히 사용할 수 있는 것은 윈도우에 포함된 원격 데스크톱입이다. 별도의 소프트웨어를 설치할 필요 없이 활성화만 시켜주면 됩니다.(단, Windows Home 에디션에는 이 기능이 없으므로, Pro 이상의 에디션을 구입하거나 다른 방법을 찾아야 합니다.) 원격 데스크톱으로 연결되는 것을 허용하는 것은 입니다.) 왼쪽에서 ...

윈도우 10 / 원격 데스크톱 연결을 위한 절전 모드 해제 설정

윈도우 10 / 원격 데스크톱 연결을 위한 절전 모드 해제 설정

원격으로 윈도우 10 컴퓨터에 접속하는 가장 간단한 방법은 원격 데스크톱을 사용하는 겁니다. 특별히 설치할 것도 없고, 설정만 약간 변경해주면 됩니다. 원격 데스크톱 연결 허용은 에 들어간 다음... 를 켜면 됩니다. 그런데, 컴퓨터가 절전 모드라면 원격 접속이 되지 않습니다. 그래서 컴퓨터를 사용하지 않아도 절전 모드로 들어가지 않게 설정을 ...

윈도우 11 / 파일 탐색기 / 분류 없애는 방법

윈도우 11 / 파일 탐색기 / 분류 없애는 방법

파일 탐색기에는 정렬과 분류 기능이 있습니다. 정렬은 목록에 표시된 파일·폴더의 순서를 바꾸는 기능이고, 분류는 그룹화하는 기능입니다. 예를 들어 분류 기준을 수정한 날짜, 정렬 기준을 이름으로 하면, 날짜 기준으로 그룹화되고 그 안에서 이름을 기준으로 정렬합니다. 만약 분류가 불편하다면 다음과 같은 방법으로 해제할 수 있습니다.

Ubuntu 22.04 Server / 원격 데스크톱으로 연결하는 방법

Ubuntu 22.04 Server / 원격 데스크톱으로 연결하는 방법

GUI 설치 우분투에 GUI를 설치한다. # apt install ubuntu-desktop-minimal xrdp 설치 xrdp를 설치한다. # apt install xrdp 방화벽 설정 원격 데스크톱은 3389 포트를 사용하므로, 방화벽을 사용하고 있다면 포트를 열어 준다. ufw allow 3389/tcp 원격 데스크톱 연결 원격 데스크톱으로 접속한다. 아래와 같은 창이 뜨는데, 를 클릭한다. 계정 정보를 입력하고 를 클릭하면... 원격지에서 GUI로 우분투를 즐길 수 있다.

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

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

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

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