SSH Escape Sequences
lonesysadmin.net
lonesysadmin.net
Basically, however deep you are you need to send that many ~s before the period.
Isn't it exponential? To escape ~, you need ~~. To escape ~~, you need ~~~~. To escape ~~~~, you need ~~~~~~~~. Etc.
~otheruser/bin/cat
it won't conflict with an ssh escape sequence (although you won't see the ~ appear until you've typed ~o).
On the other hand,
~Randomuser/bin/cat
would be impossible to type immediately at a new command prompt over an ssh connection (though of course it's possible to run such a command by typing anything such as "x<Backspace>" first).
For example, <newline>~~~~ will send <newline>~~~ to the remote side.
https://news.ycombinator.com/item?id=2060597
Note that the "up arrow" referred to in the song is not the current up arrow on the cursor keypad. Some early versions of ASCII-ish had an up arrow where the caret is now. And telnet actually mostly used control-], not control-^ anyway. I seem to recall Steele saying that he used "up arrow" because it worked better in the lyrics. I heard Steele sing this once and I think I recorded it.
In the edge-case scenario of a glitchy link that appears frozen, it's entirely possible that my Enter keypress might actually make it through and then do something I don't want.
I've had mouse and keyboard input get through to seemingly-frozen VNC sessions, so...
Still not satisfied about it, as there are plenty of situations where that doesn't help. Being in emacs, for example, it could make things worse...
If you've sshed into another box first, use ~~. to only reset the embedded session.
It usually works...
I agree that it would be nice if /any/ terminal escape sequence followed by ~ would initiate the escape.
:wq ZZ
Doesn't require a CR and therefore less likely to be submitted accidentally.It's TCP so the connection either breaks or arrives in order.
stty raw; cat
... and while every key I tried now had its literal effect, including enter producing only a carriage return and Ctrl-C, Ctrl-V etc. producing their control characters (I think, I cannot see them :) ), <enter>~. still terminated the connection. Lucky terminal combination maybe?It has happened to me though. Maybe a curses crash can leave it a state other than raw? One of the other modes such as inlcr plus ..? Also I suspect smart terminals and shells prevent a interactive session from getting too crazy.
Edit: Oh, you mentioned that yourself already, inlcr.
Sing the Telnet song!
I learned that when implementing a tiny part of the telnet protocol in a retro computer emulator's serial port emulation routines, mostly just to enable character mode and proper (non-)echoing. (I also implemented the RS232 control lines, so that telnet'ing into the port actually behaved like a physical terminal would with respect to carrier detect and all that, but I think there wasn't any overlap with the telnet protocol itself. Maybe flow control.)
This is just the part of it that interprets SUPDUP codes -- layered on top of the rest of the terminal emulator that emulated H19 (VT52 + character/line insert/delete):
https://en.wikipedia.org/wiki/Mark_Crispin
https://tools.ietf.org/html/rfc748
IAC WILL RANDOMLY-LOSE
The sender of this command REQUESTS permission to, or confirms
that it will, randomly lose.
IAC WON'T RANDOMLY-LOSE
The sender of this command REFUSES to randomly lose.
IAC DO RANDOMLY-LOSE
The sender of this command REQUESTS that the receiver, or grants
the receiver permission to, randomly lose.
IAC DON'T RANDOMLY-LOSE
The command sender DEMANDS that the receiver not randomly lose.https://en.wikipedia.org/wiki/Out-of-band_data
http://www.serverframework.com/asynchronousevents/2011/10/ou...
Didn’t know that, seems useful. Especially because another comment in this thread since mentioned that they often kill their ssh sessions because of runaway processes.
Overall, it seems to me that a lot was lost when giving up telnet.
Esc Esc Esc Ctrl-U Ctrl-C Enter AltGr-] Space .
OpenSSH lets you map EscapeChar to something more convenient, but it doesn't allow multibyte characters.
Someone should make a patch. I want to use :hankey: as the EscapeChar.
EDIT: Apparently HN swallows emojis. I can see why.
The main reason I prefer to kill via tmux rather than OpenSSH is because sometimes I'll be connected several sessions deep (eg via a Bastian / SSH jumpbox or tmux itself might be running remotely) so the tmux kill is easier than having to remember whether I need to ~. or ~~.
But ultimate there is no right nor wrong way to do things here, it's all just a question of preference and habit.
There are actually more things supported by ssh than are exposed here (clone and stuff) but just not implemented in openssh's ssh client.
They look neat though, better than having to restart the session to forward ports. Too bad it doesn't work in PuTTY.
true though.
In many European keyboard layouts, including the Finnish layout used by original SSH's author, tilde (~) is a compose key and a chore to type. It is usually expressed by typing AltGr+¨ followed by Spacebar: https://en.wikipedia.org/wiki/Tilde#Keyboards
English is one of the few keyboard layouts where a person can express ~ with one, rather than two, handstrokes. For others, terminating an SSH session with the escape character usually requires blindly typing this four-part sequence: Enter, AltGr+¨, Spacebar, Dot.
I know you can change the escape character with ssh_config(5), but no one who used a non-English layout would have ever chosen ~ as the default to start with. I've always felt like it had to be an OpenSSH-specific feature, because I knew the original author of SSH (before the open-source codebase became OpenSSH) used the same KB layout as myself. ;)
I mean, it's a good practice to read manpages every now and then, just to learn new stuff (in the same way that there are always new vim commands to learn). But we encounter so many comands with so many options that knowing all of the options is just implausible.
https://lonesysadmin.net/2011/11/08/ssh-escape-sequences-aka...
Self hosted AMP is just a lightweight version of the site isn't it?
You yourself use recaptcha on the site in your profile and a gist script from GitHub on your blog
> a 3rd-party script/xhr is required to display the content
Way too many websites just stay blank when JS is disabled, even though HTML is very capable of displaying text.
I can't fight the spam bots myself so I have to hide my email behind that captcha for practical reasons (which is not a part of my site, it is a popup).
Other than that, there are nothing 3rd-party there. And everything loads pretty fast without any alien scripts (or any scripts at all for that matter).
Mind you, these are sites that can be served perfectly with a 1Kb HTML page + a bit of CSS. Not web apps or anything, where I understand you'd want to load a bunch of XHR requests.
The AMP versions usually lose formatting and links, and are designed to be read on a small mobile screen. I'd rather have the full version when I have a big screen available.