How can I bypass the Prompt in SFTP

I am on a sun solaris server and trying to create a script that will test if SFTP is up and running on a remote server (which could be unix or windows).

My thought was to simply invoke sftp and if I get the prompt ofr "Password" then that is an indication that the service is running and I am done.

The problem is that the "prompt" for password takes over the and is wainting for a reply.

This script will run as a sceduled task (cron) to validate the service is up and will simply hang.

Is there a way to capture the fact that password is prompted for and then terminate the script.

What about using SSH keys between the systems?

I was looking a for a simple method that would not require full logon to the remote site. using a pub/private key pair would work but will require I obtain a logon and password to the remote servers - which we were looking to aviod since access to the servers would involves security approval - we just want to know if the service is up.