The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 04-21-2009
pierluigi22 pierluigi22 is offline
Registered User
  
 

Join Date: Apr 2009
Posts: 2
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.