Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Handling unexpected prompts in background script 2

Status
Not open for further replies.

TSch

Technical User
Jul 12, 2001
557
DE
Hi folks,

I wrote a shell script and put it into crontab for regulary background processing ...

So far so good.
The problem I'm facing is with the ssh call within the script. We're using a mechanism that allows us to ssh to certain system without having to provide username and password. But sometimes the host keys may change so that in these cases the ssh will prompt for a yes/no in order to add the new key. But when running the script in the background I won't notice such situations and the script will just quit without doing anything. In fact I don't even really care about being noticed about the yes/no prompt ;-) I just want the script to automatically react if such a situation occurs and to provide the required "yes" to the ssh ...

what's the best way to accomplish this ?

Regards
Thomas
 
A Christmas star for the laugh, p5wizard!

I want to be good, is that not enough?
 
Not sure any of those top Google hits actually answers the exact question though. :)

Try ssh -o StrictHostKeyChecking=no hostname. Of course you are disabling a security facility by doing this, but that's the same as just typing "yes" every time...

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top