Operating System - HP-UX
1753479 Members
5028 Online
108794 Solutions
New Discussion юеВ

Example of how to use "expect" with ssh ftp

 
Clement_7
Occasional Advisor

Example of how to use "expect" with ssh ftp

Hi, anyone got an example of how to use "expect" for inserting the password for my ssh ftp cronjob in HPUX 11.0
3 REPLIES 3
Nicolas Dumeige
Esteemed Contributor

Re: Example of how to use "expect" with ssh ftp

Hello,

Take a look at this :
http://www.cpqlinux.com/expect.html

Cheers

Nicolas
All different, all Unix
Geoff Wild
Honored Contributor

Re: Example of how to use "expect" with ssh ftp

Here's an example....

You call it from a shell script.

In your shell script, something like:

# FTP the file to the target host
# log into the fuelsale directory via EXPECT utility
# parameters: username, server, password, source directory, source filename, log filename
expect-sftp.exp $uname $target_host $pwd $srcdir $srcfile


Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Lee Hundley
Valued Contributor

Re: Example of how to use "expect" with ssh ftp

Why not use public/private key authentication?

http://www.noah.org/ssh/publickey/
It is my firm belief that it is a mistake to hold any firm beliefs