Cisco Break Sequence for Outgoing Telnet and SSH Sessions

Posted on in Networking

There are a few network devices out there that allow you to connect, but don't give you an option to disconnect. For example, you might be stuck at a password prompt, but have no authentication details. Most telnet clients allow you to break these connections with the ^] (control-]) command. <acronym title="Secure Shell">SSH</acronym> clients have similar command sequences to force those sessions to disconnect. If you've ever gotten into this situation while connecting from your Cisco router, you're aware that these commands do not work in Cisco IOS. (In fact, if you are connected via one of the above methods, you'll just be disconnected from your Cisco device!)

The proper sequence for breaking outgoing sessions on a Cisco device is to first suspend the session with control-shift-6 + x. This will return you to the Cisco command prompt on the device that initiated the session. If you hit enter, you will be sent back into the remote session. You can see a list of outgoing sessions using the show sessions or where commands. A unique connection number precedes each session in the list. To disconnect that session, simply use the disconnect command followed by the connection number.

Here's the sequence in a nutshell:

  1. telnet \<hostname or IP address>
  2. control-shift-6 + x
  3. show sessions - this isn't necessary if you know the connection number.
  4. disconnect \<connection number>

My Bookshelf

Reading Now

Other Stuff