If you have to use a password, you will need the input to ssh connected to a 
tty.  The easiest way is to use Expect or Perl/Expect to handle the transfer.  
Both of these create a pseudo TTY that the ssh command gets.

The reason your getting the prompt when piping is ssh reads from the tty instead 
of stdin for security reasons.  It is the same problem you would get is you 
tried piping input into the passwd command.

        --Dave
        
>Date: Fri, 6 Jul 2001 13:30:51 -0400 (EDT)
>From: Philip Mak <[EMAIL PROTECTED]>
>X-Sender: <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Subject: How to make ssh not read password from terminal?
>MIME-Version: 1.0
>
>I'm trying to do:
>
>echo "password" | ssh host -l user
>
>But it still tries to read my password from the terminal. Does anyone have
>a simple solution to make this work?
>
>I'm trying to setup a permanent ssh tunnel between two machines. The
>startup file on one machine will need to open the ssh connection to the
>other machine.
>
>I thought about using public key authentication, but the ssh-keygen on my
>system is broken. I figured it would be easier to just use the password
>rather than trying to reinstall ssh. Does anyone know how I can make the
>above echo command work the way I want it to?
>

--
David Knight French                           
Black Mountain Computer Consulting
Voice: (858)573-2959
Email: [EMAIL PROTECTED]

Reply via email to