2009-09-09

Put SSH in the background

While looking for something unrelated in SSH's manpage I came across something I didn't know before: when logged into a remote machine various escape sequences are supported to talk to the local end of the connection.

It's possible to do fancy things like add port forwardings or remove existing ones but I think the only one I'll now use commonly is ~^Z, which is like sending ^Z to your local shell and backgrounds the SSH process. You get your local shell back, can run whatever commands you need and then foreground SSH again with fg.

The escape character (~ is the default) has to come after a newline character to be recognized as special.

I've entirely forgotten what I was actually looking for in the manual.

No comments:

Post a comment