Closing Telnet Sessions
You can end Telnet sessions a few different ways—using exit or disconnect is probably the
easiest and quickest:
ap>exit
[Connection to 10.1.1.2 closed by foreign host]
Corp#
Since the ap device was my last session, I just pressed Enter twice to return to that session.
To end a session from a local device, use the disconnect command:
Corp#sh session
Conn Host Address Byte Idle Conn Name
2 10.2.2.2 10.2.2.2 0 0 10.2.2.2
Corp#disconnect ?
<0-0> The number of an active network connection
qdm Disconnect QDM web-based clients
ssh Disconnect an active SSH connection
Corp#disconnect 2
Closing connection to 10.2.2.2 [confirm][enter]
Corp#
If you want to end a session of a device attached to your local device through Telnet, you
should first check to see whether any devices are telnetted into your router. To get that information,
use the show users command like this:
R1#sh users
Line User Host(s) Idle Location
* 0 con 0 idle 00:00:00
vty 194 idle 00:00:21 10.2.2.1
This output shows that VTY has IP address 10.2.2.1 connected. That’s the Corp router.
Also notice that the Corp router connected to line 194—remember, you cannot choose which
line you connect to! This is why I set the same password on all lines.
To clear the connection, use the clear line # command:
R1#clear line 194
[confirm][enter]
[OK]
R1#sh users
Line User Host(s) Idle Location
* 0 con 0 idle 00:00:00
This output confirms that the line has been cleared.