in reply to Replying to prompts in an automated script

You want to set up passwordless keys for ssh. Automating entering the password is tedious, you will have to use Expect for that, or possibly use a Perl ssh client, like one of those that can be found through SSH. I recommend simply using passwordless keys.

Ooops - I just realized that you want/need to accept the hosts fingerprints. I don't know any way other than Expect for that, except finding the fingerprint via other means, and storing it in the .ssh/known_hosts file yourself.