Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
When I SSH into another system and press Ctrl-Z, I expected the SSH client to go into background. However, it's the remote process that does that. Where does the magic happen?
The SSH client disables special key handling (stty -icanon -isig options) for the local tty, so when you press CtrlZ, the client just reads the raw byte 0x1A and forwards it to the server.
stty -icanon -isig
OpenSSH supports a special command to suspend the client – Enter, then ~, followed by CtrlZ.