Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Following is the sequence:

  • Telnet from a terminal session to a remote linux machine, Call it A.
  • Telnet to some device, Say B, that is accessible only from A.

Now, How do I quit the telnet session to B and stay live on A?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

Using the inetutils version of telnet client, you can use the send escape command:

a$ telnet b
  b$ telnet c
    c$ ^]
telnet> send escape
  telnet> q

Or use the logout/disconnect command of C:

a$ telnet b
  b$ telnet c
    c$ exit

And stop using telnet, damn it.

share|improve this answer
the first solution worked for me,... and I can not use logout or exit because c is not a linux machine, its an embedded box... – Mallik Mar 7 '12 at 5:22

Could you use a different escape sequence when logging in to either A or B? For example,

telnet -e ^Q A
telnet B

gives you ^Q on A and ^[ on B.

share|improve this answer
Thanks for the solution, But the problem is I am not using telnet program directly, but it is being used inside the script that I use to log in to the box... Thanks anyways... – Mallik Mar 7 '12 at 5:20
You should be able to change the escape character from the escape mode as well: press ^], tell telnet to set escape ^Q (or whetever) and carry on. – taneli Mar 7 '12 at 8:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.