On Thu, Mar 29, 2007 at 09:49:35AM -0700, [EMAIL PROTECTED] wrote:
> > How do you explain this:
> > 
> > I am in a ssh session.  I type "~." to end the session.  The first time it 
> > says command not found, the second time the escape character is recognised 
> > and executed, I am logged out.
> > =========================================
> > $ ~.
> > -bash: ~.: command not found
> > $ Connection to blah.blah.blah. closed.
> > =========================================
<snip>
> This might be what you were seeing, if you had just used "~~." to
> terminate a nested session.

You are on the right track, but not quite:

>From the man page: the ~ character has to be preceded by a newline to be 
recognized as special. The reason that ~~. followed by ~. does not terminate 
your initial connection is because the first layer of ssh still thinks
you are typing on the same line. Basically the first layer of ssh sees this
sequence "~~.~." and the first two tildes makes it think: ah, this is not 
an escape sequence, and sends the string "~.~." to the remote shell, the 
first two of which gets trapped by the second ssh layer to mean disconnect
and the second two characters is just received by the shell. 

So, most likely the OP was typing something/anything that gave him a empty 
prompt without hitting a newline (hitting ^C, ^Z on a running program or 
just on the shell, typing something and hitting backspace to delete it...)

Incidentally, you shouldn't need to hit the newline before the disconnect
occurs. The minute you actually see the ~ appear on the screen you should 
know that it is not being interpreted as an escape character. 

W
-- 
Willie W. Wong                                      [EMAIL PROTECTED]
408 Fine Hall,  Department of Mathematics,  Princeton University,  Princeton
A mathematician's reputation rests on the number of bad proofs he has given.
-- 
gentoo-user@gentoo.org mailing list

Reply via email to