I was wondering how to kill a running script in this situation: Two machines; machine1 and machine2. machine1 writes: ssh machine2 << 'ENDSSH' ./script.sh ENDSSH causing the script to be run on machine2.

Is there a quick way from machine2, to kill the running script? Perhaps a kill all background jobs command or something?

Ok after reading about I have noticed something. I always get this message after the ssh stuff. Pseudo-terminal will not be allocated because stdin is not a terminal. Here the job is not allocated to a terminal and this can be seen where the ps command and job command do not reveal that a script is running. How can I allocate a tie to the currently running terminal? Thanks


The quickest way would be

ssh machine2 pkill skript.sh
  • this doesn't seem to work... What is weird (when trying this using ssh localhost) is that once the script information is sent and started on the machine, the job and process cannot seem to be found as if it is running on a separate screen. But there also do not appear to be any screens running (I'll keep trying). Have you got any suggestions? – Saad Attieh Mar 31 '13 at 5:01
  • if it helps I also get this message: – Saad Attieh Mar 31 '13 at 5:04
  • Pseudo-terminal will not be allocated because stdin is not a terminal. (this message appears after running the script) – Saad Attieh Mar 31 '13 at 5:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.