sexta-feira, 16 de setembro de 2011

Disconnect Stalled SSH Session

Muito boa essa dica:

This doesn't really apply to Windows users as you can just close puTTy. But for everyone else, stalled SSH Sessions suck. You are either slamming enter to get it to realize it's been disconnected or just waiting for it to. Well, for those of us who are impatient just hit:
~.
Thats right, SHIFT + the key above TAB, release, and hit the period. You may have to hit ENTER first to clear the buffer or whatever it does, but do that and it will disconnect the SSH session right away.
Stupid trick, but I use it all the time (especially on shotty MiFi connections).

The ~ is the escape character, similar to Ctrl+A in screen. If you try ~?, you get the following dialogue:
$ ~?
Supported escape sequences:
~. - 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.)
Another very useful trick is to use ~C to open a command line, then use -L or -R to add additional SSH forwarding tunnels without breaking your existing SSH connection.


 fonte: http://www.room362.com/blog/2011/9/15/disconnect-stalled-ssh-session.html

Nenhum comentário:

Postar um comentário