Telnet - How Do I End a Telnet Session (Windows, Linux, Mac)

Question: How do I close a telnet session/window?

This article assumes that you've started a telnet connection through the Windows command prompt (you can do so by typing: "telnet address port").

Answer: To end your current telnet session you must reach the telnet prompt and type quit.

Here are the steps for doing so:
1. Open the telnet prompt by holding down the 'Ctrl' key and push the ']' key. (prompt: Microsoft Telnet>)

2. Type quit.

3. Push the 'Enter' key.

You can change this default telnet prompt key by starting telnet like this:

telnet –e p  192.168.1.81 (this will change the telnet prompt key to lowercase 'p')


12 Responses to “How to end a telnet session (Windows, Linux, Mac)”

  1. Nikhil says:

    Hey,
    Thanks a lot. I had opened a telnet connection and had no idea how to close it until I came across this!!
    By the way, I am logged in Ubuntu. So the steps you have mentioned for windows work for linux as well.

    Reply
    • cpascu says:

      Good to know, changed the title accordingly :)

      Reply
  2. thomas says:

    Hi,
    great post, could you please mention, that this also work with other key mappings? e.g. on german keyboards the ‘]’ is a composed key, but the same key position as on english keyboards works: use [Ctrl] + [+] there.
    Regards,
    Thomas

    Reply
  3. M L Sreekanth says:

    THANKS ALOT…… Everytime i used to close the window or putty to come out of the session.

    Reply
  4. Jimmy says:

    @MLSreekanth – me too!

    This is HELPFUL!

    I’m on mac OS X 10.6.6 and the same key commands work to get the prompt so that you can properly close the window. You could add Mac to the title of the page, too!

    Thanks!!!

    Reply
  5. Neetish Jethra says:

    Thanks, very handy

    Reply
  6. omo olorun says:

    nice one thanks!

    Reply
  7. sameet says:

    So I am curious as to What Ctrl+C does not do that this does or are they the same. What I am trying to get at is does Ctrl+C leave open/lingering connections

    Reply
  8. ?uro says:

    For non English keyboard you can press and hold Alt key then enter 29 on num keypad. This will send ‘^]’ control character to the terminal according to the ASCII table.

    Reply
  9. Shilpa says:

    How to kill a telnet session, when the telnet console window is closed mistakenly.

    Reply
  10. Nene says:

    Thanks a lot, it help me a lot.

    Reply
  11. MJ says:

    in linux, I type echo|telnet server_ip tcp_port
    this will help me not to enter the escape character but will end the telnet session be it good or bad

    what is similar option in windows?

    Reply

Contact Us

Contact us via phone (+1 866-383-1657) or leave a detailed message below for sales, support, or any other needs

I'd like to receive the newsletter. *Check email for confirmation.
*Required Field
Preferred Time To Be Contacted (PST)
8:00am - 12:00pm 12:00pm - 5:00pm