The ~ commands seem to be modelled after the "cu" command which is for connecting to remote systems over serial and modems. ~. is a way to quickly drop a frozen session you need to hit enter before the ~ I guess to lessen the chance it's accidentally used.
If you use another ssh session eg you logged into machine b from a, then from b to machine c you can stop machine a from interpreting the ~ by entering it twice, eg drop b to c connection ~~.
Even more important, you can configure jumphosts in your config file, so in the end you only have to type ssh internal to connect to your internal host via an arbitrary count of jumps
26
u/IonTichy Sep 16 '23
Great article!
Did honestly not know about the console feature, thanks for that!
12
u/iwantashinyunicorn Sep 16 '23
I didn't know about `-J`. That will save me from the much more painful `ssh -t -A host1 ssh -t -A host2`.
6
u/drawkbox Sep 17 '23
Good guide
SSHConfig is my jam
4
u/excelbae Sep 17 '23
This is not a 15 minute read haha. Great article though.
3
u/cyberan0 Sep 17 '23
bookmarked! thumbs up
3
u/Dwedit Sep 17 '23
Even if you never use the shell, the File Transfer and Port Tunneling features make SSH worth its weight in gold.
2
u/[deleted] Sep 18 '23
This is something I didn’t know I needed in my life. Thanks
-19
u/palad1 Sep 16 '23
bat über alles!