I have a SSH session with a VM running on Amazon AWS.
One of the programs I had run hung up and froze the SSH terminal.
So I hit Enter+~+.
Now when I am trying to connect to my machine it says connection timed out.
- Does this mean that connection was only terminated from the client
side and is still active on server? If so how do I create a new
connection? - Ctrl+C does not work on a SSH shell. Does this mean it is not
possible to terminate the hung up command without terminating the
SSH session?
Best Answer
You can send a SIGSTOP to the process (most shells use
Ctrl-Z
for this), which will tell the present process pause it's current state. This should then return you to your shell command prompt. You can then see what jobs are paused with thejobs
command and then kill the process with thekill
command. If the process is number 1 in the list of the output ofjobs
then you would issue kill -TERM %1 (and check it has gone withjobs
once more). You may have to send a SIGKILL instead (kill -KILL %1
).A simple guide to job control can be found at:
http://en.wikibooks.org/wiki/A_Quick_Introduction_to_Unix/Job_Control