Davis, Ricardo C.
2001-Mar-15 20:53 UTC
Support for here documents with sftp client in OpenSSH 2.5.1p1-1 (RH Linux 6.2 [2.2.x kernel])
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
Darren J Moffat
2001-Mar-15 20:58 UTC
Support for here documents with sftp client in OpenSSH 2.5.1p1-1 (RH Linux 6.2 [2.2.x kernel])
"Davis, Ricardo C." wrote:> ...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?What about using the ssh-agent since sftp runs over ssh having the keys in the agent will mean you don't need to pass them into sftp every time. -- Darren J Moffat
Markus Friedl
2001-Mar-15 21:02 UTC
Support for here documents with sftp client in OpenSSH 2.5.1p1-1 (RH Linux 6.2 [2.2.x kernel])
On Thu, Mar 15, 2001 at 03:53:07PM -0500, Davis, Ricardo C. wrote:> 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:this work fine with non-interactive authentication. you can try publickey. -m
Damien Miller
2001-Mar-15 23:26 UTC
Support for here documents with sftp client in OpenSSH 2.5.1p1-1 (RH Linux 6.2 [2.2.x kernel])
On Thu, 15 Mar 2001, Davis, Ricardo C. wrote:> 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>I don't think the sftp client will ever support this syntax - it would be difficult to implement and would encourage the use of plaintext passwords in scripts.> 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?This is not going to happen either - commandlines are visible to all other users of your system using ps.> ...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?You can use public key authentication - this is exactly what it is designed for :) -d -- | Damien Miller <djm at mindrot.org> \ ``E-mail attachments are the poor man's | http://www.mindrot.org / distributed filesystem'' - Dan Geer
Possibly Parallel Threads
- "Windows" share issue; access via smb:// fails, "mount -t cifs" works
- Specifying path to a windows server
- Support for here documents with sftp client in OpenSSH 2.5.1p 1-1 (RH Linux 6.2 [2.2.x kernel])
- Problems with Tiger SMB connections
- Device not configured (explanation)