Korean

telnet — Raw TCP connection and port check

Linux / Network and Firewall / telnet.html

Network and FirewallOriginalRegistered 2026-10-20T09:00:00+09:00

A classic client that opens a raw TCP connection so you can see what a service answers.

Basic Information

Command Nametelnet
One-line IntroductionA classic client that opens a raw TCP connection so you can see what a service answers.
Provided bytelnet client (packaged by distributions)
Official Documentationhttps://man7.org/linux/man-pages/man1/telnet.1.html
Supported Operating SystemsLinux, macOS, BSD
Installation StatusPackage required (apt install telnet)
CategoryLinux networking (tags: Address, port and firewall management (tags: TCP, port, connection, diagnose))

What is this command?

telnet opens a TCP connection and sends whatever you type without encryption.

It is used for port checks and legacy text protocols, not for secure remote login.

What problems does it solve?

  • Check whether a service listens on a port.
  • Verify that a firewall rule allows the path.
  • Exercise plain-text protocols such as SMTP or HTTP by hand.
  • Read the banner and response exactly as sent.

Key features

Port connection

Give a host and port to attempt a connection.

  • When to use: When you need a quick open/closed check.
  • What you get: A banner or prompt appears when it connects.
  • Limitations: Nothing is encrypted, so never send secrets.

Protocol test

After connecting, type protocol commands and read the replies.

  • When to use: When inspecting plain-text service replies.
  • What you get: You see the raw response from the server.
  • Limitations: Being interactive, it is poor for automation.

Exit

Close the session with quit, or Ctrl+] followed by quit.

  • When to use: When cleaning up after a test.
  • What you get: The connection closes cleanly.
  • Limitations: Some servers keep the connection open.

Installation and usage

Check whether it is installed

telnet -h

sudo apt install telnet

Real-world examples

Port check

Connect to a web port and read the banner.

telnet example.com 80

SMTP test

Read the greeting of a mail server.

telnet mail.example.com 25

See a refusal

A closed port is refused immediately.

telnet 127.0.0.1 9