5 ms·
Tip: If you want to escape from any ssh session you can press this sequence: 1. <Enter> Press Enter. 2. ~ Press Tilde. 3. . Press dot. This disconnects from
by cientifico 6y ago
Tip: If you want to escape from any ssh session you can press this sequence:
1. <Enter> Press Enter.
2. ~ Press Tilde.
3. . Press dot.
This disconnects from the remote host.
If you want more: `man ssh` and look for "ESCAPE CHARACTERS"
- afranchuk 6y agoI think the sequence is "<Enter>~.". I use it often.
- cientifico 6y agoThanks. Corrected.
- 411111111111111 6y agowhy not use the logout shortcurt ^d ? this abort sequence is so much move involved vs just ^c ^d -ing
- EE84M3i 6y agoThis shortcut works even if the remote side isn't responding to ^c and/or ^d. It's handled by the local client. The two primary use cases I've found it useful are when I accidentally wedge the remote box by using up all of some resource or when some other event causes my network connection to hang and I don't want to wait for a timeout.
- 411111111111111 6y agoyeah, i was specifically confused about him having to use it often. it is sometimes useful, like when you're connected to the demo site and cba to figure out how to disconnect. but such situation are so rare that i was confused about the remark how often he uses it.
- EE84M3i 6y agoI use it pretty often because I have SSH sessions that get messed up from (dis)connecting my VPN and I'm impatient.
- Ignacy-s 6y agoIf you do the first connection with mosh instead of ssh, it will survive vpn/wifi/4g roaming and even system hibernation. Assuming that first hop is a vps in the cloud with a stable connection, you can literally wake your pc from hibernation and once you get any Internet access, mosh will happily restore your "ssh" session for you. mosh.org: >Mosh will log the user in via SSH, then start a connection on a UDP port between 60000 and 61000. Needs at least a couple of ports in that range open, because old sessions tend to block ports until they are cleaned.
- EE84M3i 6y agoI use mosh for personal stuff. My work does not allow mosh.
- rusk 6y agoC^D instructs the server to disconnect you. With these tilde commands you are issuing client side instructions.
- rusk 6y agoYou can do ? instead of . and it will tell you what else it can do. Client side escape sequences. Handy to know!