ugh, how do I ctrl-C out of a connection to a remote server when I'm done?



Sometimes in an SSH window, I will try and connect to another host on
port 80 or 25, to see what happens if I send a request consisting of
certain headers, and what response the server sends back. The problem
is -- and this seems like a real newbie question, but nothing I have
tried works -- is that once I'm done getting the response back,
sometimes the remote server doesn't close the connection, and nothing
I do on my end - Ctrl-X, Ctrl-C, Ctrl-Z, or whatever -- causes the
connection to close. What do I press to make the connection close, so
that I get my shell prompt back?

(I am actually on a Windows machine using an SSH client to connect to
a CentOS host that I run, before telnetting from that CentOS host to
the remote host. However I'm not sure if that should matter since
when I press Ctrl-C or Ctrl-X or whatever, the SSH program seems to
pass that straight through to the remote CentOS host just as if I'd
pressed the same keys on a local terminal.)

A typical transcript looks like this. That ^X ^c junk at the end is
me jamming the Ctrl-C and Ctrl-X keys trying to make the connection
close.


[root@fast ~]# telnet www.facebook.com 80
Trying 69.63.176.40...
Connected to www.facebook.com (69.63.176.40).
Escape character is '^]'.
GET / HTTP/1.1
Host: www.facebook.com

HTTP/1.1 302 Found
Date: Fri, 27 Mar 2009 23:21:39 GMT
Server: Apache/1.3.41.fb2
P3P: CP="HONK"
Set-Cookie:
nectar=1238196099-7a322935129f35cbe1c755f1d46259a43cc4873c4990488c89e24;
expires=Sun, 20
-Mar-2039 23:21:39 GMT; path=/; domain=.facebook.com; httponly
Set-Cookie: datr=1238196099-
e50fea765c3369f89f388a31fba99cb84714e3a701e8dc49d01bb; expires=Sun, 26-
A
pr-2009 23:21:39 GMT; path=/; domain=.facebook.com; httponly
Location: http://www.facebook.com/common/browser.php
X-Cnection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=utf-8

0



^X

^X
^A
^Xxcc^Xc

.



Relevant Pages

  • Re: How to create an ssh chain A->B->C to do http over ssh across the chain?
    ... running the following on host A: ... will be forwarded over an SSH connection to port 8080 on host B. The ... second "ssh" command running on B, meanwhile, will then act as a SOCKS ...
    (Debian-User)
  • understanding chkrootkit: sshd section
    ... Rhosts Authentication disabled, originating port will not be trusted. ... Secure connection to %.100s on port %hu refused%.100s. ... Warning: Remote host refused compression. ... Received RSA challenge from server. ...
    (comp.os.linux.security)
  • understanding chkrootkit: sshd section
    ... Rhosts Authentication disabled, originating port will not be trusted. ... Secure connection to %.100s on port %hu refused%.100s. ... Warning: Remote host refused compression. ... Received RSA challenge from server. ...
    (comp.security.unix)
  • Re: ICS and FS trouble
    ... >>>client for ms networks, service advertising protocol, file and printer ... >>>execept that the MS beta AntiSpyware connects to the internet and recognises ... >> Microsoft doesn't support changing the ICS host computer's LAN ... >> Internet connection has a 192.168.0.x address that can't be changed to ...
    (microsoft.public.windowsxp.network_web)
  • Re: Password Guessing
    ... > I have an ssh gateway linux-box which is the victim of daily visits by ... Like this, on any ssh connection the script ssh-throttle will be called, ... supplied with the IP address of the source host, ...
    (comp.security.ssh)