ssh hang on wrong port - is it a bug ?
Hari
hari at isofttechindia.com
Mon Jun 17 20:34:14 EST 2002
As seen below, telnet and ftp sessions do not hang on wrong port no.
They just print the ssh banner and exit.
Wouldn't this be expected for ssh too, to exit when they get connected to a
wrong server.
As for the client time out, can this be provided as a configurable option
(with some low default values), so that ssh clients do not hang infinitely
on a wrong port. For those with slow links, they could consider increasing
the time-out.
Thanks,
Hari
[hari at linux hari]$ telnet 192.168.0.32 22
Trying 192.168.0.32...
Connected to netra (192.168.0.32).
Escape character is '^]'.
SSH-2.0-3.0.1 SSH Secure Shell (non-commercial)
Connection closed by foreign host.
[hari at linux hari]$ ftp 192.168.0.32 22
Connected to 192.168.0.32.
SSH-2.0-3.0.1 SSH Secure Shell (non-commercial)
ftp> pwd
Not connected.
ftp>
> -----Original Message-----
> From: Darren Tucker [mailto:dtucker at zip.com.au]
> Sent: 11 June 2002 08:37
> To: hari at isofttechindia.com
> Cc: openssh-unix-dev at mindrot.org
> Subject: Re: ssh hang on wrong port - is it a bug ?
>
>
> > Hari wrote:
> > ssh client program seems to hang when specified a wrong port no (port
> > on which some other server, like telnetd is running).
>
> Don't do that, then.
>
> > "netstat -an" shows the connection is established.
> > I expect the ssh program to report invalid server msg and exit.
> > Is this a bug or known behaviour ???
>
> ssh probably waiting for the SSH server banner. telnetd is probably
> waiting for a response to telnet option negotiation. Stalemate.
>
> A quick experiment here shows the same behaviour for ftp & http servers.
> I expected it for http (it doesn't say anything when you connect so is
> indistinguishable from a slow ssh server) but I would have thought the
> ftp server banner would have caused ssh to abort (like sshd does).
>
> --
> Darren Tucker (dtucker at zip.com.au)
> GPG Fingerprint D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
> Good judgement comes with experience. Unfortunately, the experience
> usually comes from bad judgement.
More information about the openssh-unix-dev
mailing list