How To Exit Telnet | The Escape Sequence That Works Every Time

Press Ctrl + ] to reach the Telnet prompt, then type quit — the escape sequence is the only way to close a standard Telnet session cleanly.

Telnet’s biggest surprise hits the moment you type quit and nothing happens. The session stays open, the cursor blinks, and the remote server ignores you. Knowing how to exit Telnet correctly comes down to one keystroke that switches the client back to local control. This article covers the exact sequence for Windows, Linux, and macOS, plus the variations needed for Cisco, IBM i, and Fortinet systems.

The Standard Way to Exit a Telnet Session

The escape character tells the Telnet client to stop forwarding your keystrokes to the remote server and listen for local commands. Without it, every character you type — including the word “quit” — goes straight to the connected device as data.

Follow these steps for any standard Telnet client on Windows, Linux, or macOS:

  1. Press Ctrl + ] — hold the Ctrl key and tap the right square bracket key. This sends ASCII character 29 (the escape signal) to the local client.
  2. Check the prompt change — the display switches from the remote session to the Telnet client prompt, shown as telnet> or Microsoft Telnet>.
  3. Type quit — enter the command at the telnet> prompt. The abbreviation q works on most clients.
  4. Press Enter — the connection closes and you return to your local terminal.

When the sequence works, the screen shows the connection closed message and your command prompt reappears.

Why Does Typing Quit Alone Never Work?

Telnet operates in a passthrough mode during an active session. Every keystroke you enter gets sent character-by-character to the remote server, which interprets it as input within that session. The word “quit” becomes data for the remote application — not a command for the Telnet client itself.

The Ctrl + ] sequence interrupts that passthrough and returns control to the local Telnet prompt. Only from that local prompt can you issue commands like quit, close, exit, or disconnect that actually terminate the connection. Think of the escape character as the lever that switches Telnet from “remote mode” to “local mode.”

Exiting Telnet on Different Operating Systems and Devices

The standard Ctrl + ] plus quit sequence works on most Telnet clients, but several platforms use their own escape methods. The table below covers the major variations.

Platform Escape Sequence Exit Command
Windows Command Prompt Ctrl + ] quit or close
Linux Terminal Ctrl + ] quit, q, or exit
macOS Terminal Ctrl + ] quit or close
Cisco IOS (router/switch) Ctrl + Shift + 6, release, then X disconnect then exit
IBM i OS Attention key Select option 99 (End TELNET session)
Fortinet devices Ctrl + C repeatedly Wait for “Connection closed by foreign host”
Non-English keyboard (German) Ctrl + + (minus key) instead of ] quit (or Alt + 29 on numpad)

If your keyboard lacks a dedicated ] key, use the Alt code method: hold Alt and type 29 on the numeric keypad to send ASCII 29 directly. From there the same quit command works.

Common Mistakes That Keep You Trapped in Telnet

Three errors cause most of the frustration when trying to exit Telnet. Here is what goes wrong and how to fix each one.

Typing quit while still connected to the server. This is the most frequent mistake. The word “quit” gets sent as data to the remote device, which either ignores it or treats it as input. The fix is to press Ctrl + ] first, wait for the telnet> prompt, and only then type quit.

Using Ctrl + C to exit. On Windows, Ctrl + C sends an interrupt signal that may break the current command on the remote server but does not close the Telnet connection. The session remains open. Stick with Ctrl + ] followed by quit.

A hanging connection that ignores the escape character. If pressing Ctrl + ] shows ^] on the screen but no prompt appears, the connection has frozen. Your options are to wait for a timeout or close the terminal window. On Windows, open Task Manager (Ctrl + Alt + Delete), find telnet.exe in the Processes tab, and click End Process.

Chipkin’s Telnet exit guide covers the standard procedure for all three major operating systems in detail.

Why Telnet Is Deprecated and What To Use Instead

Telnet transmits everything — including usernames and passwords — in plain text over the network. There is no encryption at any layer of the protocol. That makes it trivial for anyone on the same network segment to capture credentials and session data with basic packet-sniffing tools.

Major operating system vendors have responded accordingly. Windows 10 and 11 ship with the Telnet client disabled by default. macOS and most Linux distributions include it but display a deprecation warning on first use. Modern security policies at the corporate and ISP level routinely block Telnet traffic on port 23.

The replacement is SSH (Secure Shell), which encrypts the entire session and uses the same TCP port concept. The exit experience is also simpler — just type exit directly or press Ctrl + D, with no escape character required.

Feature Telnet SSH
Encryption None (plain text) Full session encryption
Default port TCP 23 TCP 22
Exit command Ctrl + ] then quit exit or Ctrl + D
Security status Deprecated, insecure Current standard
Client availability Disabled by default on modern OS Built in and enabled

Telnet Exit Checklist — What To Remember

The single piece of knowledge that saves every Telnet session: the escape character always comes first. Whether you are on Windows, Linux, or macOS, the sequence is the same — Ctrl + ] brings up the Telnet prompt, and quit closes the connection.

For non-standard systems, memorize the platform-specific shortcut from the table above. Cisco routers need Ctrl + Shift + 6 then X. IBM i requires the Attention key. Fortinet devices may need repeated Ctrl + C presses. And when all else fails, the Task Manager process kill is your emergency exit.

If you are setting up remote access for a new project, skip Telnet entirely and use SSH. It is more secure, easier to exit, and supported on every modern system without configuration changes.

References & Sources

Please use a real email you check. If it's fake or mistyped, your message won't reach us and we can't reply — wrong addresses are rejected automatically.