News for hackers. Stuff that matters.
Re:SSH tips and tricks by psanford on Tuesday August 16, 2022 @08:50PM (#32490972)
This is a great tip that I use all the time.

To be more precise ~ is the default ssh escape character. It is only treated as the ssh escape character if it is at the beginning of a new line. From the ssh(1):

> The escape character followed by a dot (`.') closes the connection; followed by control-Z suspends the connection; and followed by itself sends the escape character once.

Re:SSH tips and tricks by GekkePrutser on Wednesday August 17, 2022 @12:09AM (#32492226)
And if you're deeper in nested SSH sessions you can use a number of ~s to indicate which one to kill.

There's more commands than the dot too but I admit I forgot the others

Re:SSH tips and tricks by francislavoie on Wednesday August 17, 2022 @02:47AM (#32493092)
Ahhh that would explain why it didn't feel consistent for me, since I use ProxyCommand to hop through another box most of the time. I usually need to do that key sequence twice. But I guess now I know I just need the tilde twice.
Re:SSH tips and tricks by fragmede on Wednesday August 17, 2022 @03:27AM (#32493332)
I think the ProxyJump config option will help you.
Re:SSH tips and tricks by tominous on Wednesday August 17, 2022 @08:05AM (#32495147)
ProxyJump (or the -J option as a shortcut) plus TCP port forwarding (-L/-R) is ridiculously powerful. You can chain jump hosts with commas, threading a port forward deep into (or out of) multiple server hops with a single command.
Re:SSH tips and tricks by jrib on Tuesday August 16, 2022 @09:18PM (#32491134)
Also,

~?

will print a list of the available escape sequences.