I have a script in bash, runing multiple putty sessions in my linux vm. For example, i open the connection to run a couple of commands, when it finishes it saves the values, closes the session, opens a new session and runs a couple more.

This script is supposed to run for 60 hours, more or less, so i need to have everythin automated.

My issue is, when the putty session is open, and connected to the device i need, if at some point the device reboots ( dont know why it reboots, it just does), a window in putty appears saying the connection was terminated (obviously). The problem is that the window stays open ulti i press the "ok" button. So my script just stops there until some manual interaction with the putty session.

Is there a way to automatically terminate the putty session if a disconnection happens? the option "Close window on exit" is already set as "Always".

Thank you for your help, if you need some more information just let me know! regards

  • Why wouldn't you just make your script to send commands through a terminal utility (e.g. ssh, or whatever protocol you use). – Hi-Angel Jun 5 '17 at 11:57
  • Because i need to have multiple session opened at the same time. I have 3/4 putty sessions at the same time running, and when all those end, i go the the next spet which open 3/4 more session to perform diferent actions. Is there a way to have thi sbehaviour with the "ssh" command? – Ichigo-San Jun 5 '17 at 12:17
  • I didn't try myself, but IIRC my colleague bruteforced a SSH password to a device. There was obvious problem of a timeout upon wrong password, and he sidestepped it just by opening a bunch of sessions. So I think the answer to your question is — yes. – Hi-Angel Jun 5 '17 at 13:14

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.