Escape sequences for SSH (when you’re stuck)Séquences d’échappement pour SSH (lorsque vous êtes bloqué)
You can get stuck with your ssh session when your network is changing or when there’s a network disruption. You will face a lock leading to the unability to stop your session, even by doing a CTRL-C.
That’s why there’s some escape sequences you can use in that case (especially the first one when you’re stuck):
1 2 3 4 5 6 7 8 9 |
~. - terminate connection (and any multiplexed sessions) ~B - send a BREAK to the remote system ~C - open a command line ~R - Request rekey (SSH protocol 2 only) ~^Z - suspend ssh ~# - list forwarded connections ~& - background ssh (when waiting for connections to terminate) ~? - this message ~~ - send the escape character by typing it twice |
Note that escapes are only recognized immediately after newline.Vous pouvez vous retrouver bloqué avec votre session ssh lorsque votre réseau change ou lorsqu’il y a une interruption réseau. Vous vous retrouvez alors avec un verrou rendant impossible de quitter votre session, même en utilisant un CTRL-C.
C’est pour cela qu’il existe des des séquences d’échappement que vous pouvez utiliser dans ce cas (tout particulièrement la première lorsque vous êtes bloqué) :
1 2 3 4 5 6 7 8 9 |
~. - terminate connection (and any multiplexed sessions) ~B - send a BREAK to the remote system ~C - open a command line ~R - Request rekey (SSH protocol 2 only) ~^Z - suspend ssh ~# - list forwarded connections ~& - background ssh (when waiting for connections to terminate) ~? - this message ~~ - send the escape character by typing it twice |
Notez bien que ces séquences sont seulement reconnues après avoir appuyé sur Entrée.