Ssh – killing a process on a remote machine when the machine is stuck

processssh

I started a very resources-consuming process on a remote server via ssh. It is an optimization problem run in MATLAB. It takes full memory and CPU. In fact, I am not even able to ssh to the machine, which doesn't reply at all. How do I kill that process? I don't have root access.

Best Answer

If your user started the process, and you only have access remotely, your options are limited.

I would try remotely killing the processes, This may take some time to get queued!

ssh -l $USER $HOSTNAME 'pkill -9 MATLAB'

If this executes, but does not kill the running process. You could always kill all processes created by your user. this would be a more last resort, obviously avoid if you know the process name.

ssh -l $USER $HOSTNAME 'pkill -9 -u $USER'

If you have any KVM or IPMI access, this would be the time to bust it out.

Related Question