Hacker News new | past | comments | ask | show | jobs | submit login

^C doesn't work because the SSH client is passing it through to the remote server (which is normally what you want), not because the client itself is stuck.

ssh has a little-known "escape character" feature for situations like this. You can type <ENTER> ~. to tell the client itself to exit, or <ENTER> ~? for a list of other escape commands.




It doesn't hurt to mash <ENTER> a few times, either, just to tell ssh that you're serious. I used to have it not work occasionally until I started mashing -- probably because it passed the newline through and I didn't make it to ~ fast enough, so whap-whap-whap ~. is my muscle memory for killing ssh now.

This is extremely useful information if you do a lot of work on remote servers, particularly when you restart networking and lock yourself out. You can get your shell back without having to kill the terminal or open another to kill ssh, which I see a lot of people do. It's too bad it's little-known.

~C is useful too so you can alter your forwarding setup (including cancelling open forwards) without dropping the connection.


It doesn't hurt to mash <ENTER> a few times

Do you happen to be an older North Carolinian? I don't think I've heard anyone use "mash" in this sense since being a bewildered Northerner in an NC elementary school in the 70's when a teacher asked me to "mash the lights". Apparently some light switches once used buttons, and "mash" was (and possibly still is) a regionalism for "press".

Is it used elsewhere too? Personally I'd use "mash" to describe preparing potatoes, and would need it for brewing beer, but I wouldn't have considered that it might be applicable to escaping from ssh. Although searching now, I see that it also seems to be a term-of-the art for rapid button pressing in video games. And I see that suggestions that it's also used in the West Indies.


>Do you happen to be an older North Carolinian? I don't think I've heard anyone use "mash" in this sense

I don't think it's quite that regional - I've heard & used it in this sense (british, not that old).

Not sure where it came from originally (people use all sorts of odd terms to describe pressing buttons, 'punch' being one I find weird).

I can think of one obvious pop reference, from The Simpsons[1]

[1] https://www.youtube.com/watch?v=OqjF7HKSaaI


As a New-Englander, the term mash comes naturally to me as meaning 'press rapidly.' But I'm also a gamer, so I may have picked it up there.


Yeah, the phrase "button mashing" is fairly common in gaming.


Would you say "mash <up-arrow> several times until" or "mash <up-arrow> until"? That is, in gaming terminology, would you ever use "mash" to describe pressing a key only a single time? Or does "mash" always describe repeatedly and rapidly pressing a key?


Mash, as it did in the above context, only describes pushing a button rapidly and repeatedly. It can be used interchangably with spam, but usually implys a shorter time frame, and when using spam, you usually name the action, not the button.

To demonstrate the difference:

"After you get knocked out in punch out, mash A to get back up"

"In Quake 2, spamming rockets to protect entryways is the only use for the stupid things."




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: