* [gentoo-user] ssh escape command
@ 2007-03-29 16:10 Mick
2007-03-29 16:49 ` felix
0 siblings, 1 reply; 4+ messages in thread
From: Mick @ 2007-03-29 16:10 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 398 bytes --]
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.
=========================================
--
Regards,
Mick
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-user] ssh escape command
2007-03-29 16:10 [gentoo-user] ssh escape command Mick
@ 2007-03-29 16:49 ` felix
2007-03-29 18:38 ` Willie Wong
0 siblings, 1 reply; 4+ messages in thread
From: felix @ 2007-03-29 16:49 UTC (permalink / raw
To: gentoo-user
On Thu, Mar 29, 2007 at 05:10:43PM +0100, Mick 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.
> =========================================
Don't know about that, but I just found a peculiarity in ssh. If I
ssh from a to b to c, "~." terminates the a-b session which also
terminates the b-c session of course. Use "~~." instead to first
terminate the b-c session while leaving a-b intact, but immediately
folloing that with "~." to terminate the a-b session does not work; it
gives "command no found" from bash. You have to give any other
command in betweenm, even ENTER alone, then the "~." will properly
terminate the a-b session.
This might be what you were seeing, if you had just used "~~." to
terminate a nested session.
--
... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._.
Felix Finch: scarecrow repairman & rocket surgeon / felix@crowfix.com
GPG = E987 4493 C860 246C 3B1E 6477 7838 76E9 182E 8151 ITAR license #4933
I've found a solution to Fermat's Last Theorem but I see I've run out of room o
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-user] ssh escape command
2007-03-29 16:49 ` felix
@ 2007-03-29 18:38 ` Willie Wong
2007-03-30 11:23 ` Hans-Werner Hilse
0 siblings, 1 reply; 4+ messages in thread
From: Willie Wong @ 2007-03-29 18:38 UTC (permalink / raw
To: gentoo-user
On Thu, Mar 29, 2007 at 09:49:35AM -0700, felix@crowfix.com 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 wwong@math.princeton.edu
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-user] ssh escape command
2007-03-29 18:38 ` Willie Wong
@ 2007-03-30 11:23 ` Hans-Werner Hilse
0 siblings, 0 replies; 4+ messages in thread
From: Hans-Werner Hilse @ 2007-03-30 11:23 UTC (permalink / raw
To: gentoo-user
Hi,
On Thu, 29 Mar 2007 14:38:41 -0400 Willie Wong <wwong@princeton.edu>
wrote:
> 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.
Just to add to the overall confusion: In many cases for non-american
keyboard layouts, "~" is configured as "dead key" in X (in order to
type things like "ñ" and such). For a "~", you effectively have to type
"~",<SPACE>. So my series of keystrokes is almost always:
<CR>,"~",<SPACE>,".". But I only need that when the connection dies,
otherwise I still prefer <CTRL>-D.
-hwh
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-03-30 11:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-29 16:10 [gentoo-user] ssh escape command Mick
2007-03-29 16:49 ` felix
2007-03-29 18:38 ` Willie Wong
2007-03-30 11:23 ` Hans-Werner Hilse
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox