Support for here documents with sftp client in OpenSSH 2.5.1p1-1 (RH Linux 6.2 [2.2.x kernel])

Davis, Ricardo C. RCDavis at intermedia.com
Fri Mar 16 07:53:07 EST 2001


A question on the cutting edge sftp client in OpenSSH 2.5.1p1-1:

Is there a standard set of commands for sftp clients?  I was hoping to use
sftp as a drop in replacement for some simple FTP transfer scripts.  In
particular, the ftp client allows specifying the password in the "user"
command:

user <account> <password>

The scripts use here documents to perform the transfers.  For example:

...
ftp -n -i -v $theServer >$logFile 2>&1 <<!
user $account $acctpw
cd $theDir
get *.dat
quit
!
...

It doesn't appear that OpenSSH's sftp client can do this.  Is it possible to
specify the password as part of the command line?  I thought this might
work:

sftp $account:$acctpw@$theServer  <<!
cd $theDir
get *.dat
quit
!

...but it doesn't.  Am I looking for something that isn't available in sftp
client implementations?  If this is true, then what options are there for
automated, authenticated transfers?


-Ricardo





More information about the openssh-unix-dev mailing list