PuTTY SSH会话被信号2终止,Ctrl+C无法正常使用问题求助
I’ve run into this exact frustrating issue before—you’re running top or a long-running command on a remote machine via PuTTY, hit Ctrl+C to stop the process, and instead of just terminating top, your entire SSH session drops. Since you confirmed MobaXterm works perfectly, we can 100% pin this on PuTTY’s default keyboard signal handling configuration.
Here’s how to fix it step by step:
- Open PuTTY (or if you’re already connected, right-click the window title bar and select Change Settings)
- In the left-hand navigation pane, expand Terminal and select Keyboard
- First, check the The Ctrl key acts as: dropdown—make sure it’s set to Control (not Meta or Meta+Control). This ensures PuTTY interprets Ctrl keys as standard terminal control signals instead of local window shortcuts.
- Next, in the Control keys section, verify that Control-C sends SIGINT is checked. This tells PuTTY to forward the Ctrl+C input as the standard interrupt signal to the remote process, rather than triggering a local session close.
- Save your configuration (update your saved session if you use one, so you don’t have to adjust this every time) and reconnect.
After making these changes, running top on the remote machine and hitting Ctrl+C will terminate just the top process, leaving your SSH session fully intact.
If you check your ssh -vvv output, you’d likely see that PuTTY was sending a local terminate signal instead of forwarding the SIGINT to the remote server—this tweak fixes that signal routing issue.
内容的提问来源于stack exchange,提问作者Jo Shepherd

