using SSH with my script and avoid logging in manually

Hi Guys.

I have 3 variables
$HOST
$Username
$Password

I want to connect to a remote server using SFTP.

usr/bin/sftp -o Cipher=blowfish $Host

Where do I put in the options for the username and pwd??? I have tried different ways and nothing works. It keeps coming back and promting me.

a piece from my script

usr/bin/sftp -o Cipher=blowfish $HOST  <<SFTP_END
user $UserName $Password
SFTP_END 

What I get in return

Connecting to mlisgcadev4...
user@host's password: 

There should be a way where I can pass in all 3 values and be on my way no???

well, not exactly.

sftp is made for interactive sessions. To overcome the password prompt, your target server must support key based authentication. Once you have your keys set up, you can use sftp in batch mode (-b), or at least login without a prompt.

See the sftp man page for more info.

You might look for passwordless ssh. Easy search.

hmmm...never heard of it to be honest...but worth googling it.

So my approach is what the Vendor wants us to do...is it at all doable?

Yes, see: The UNIX and Linux Forums > Google Search > ssh+expect

Ok, so it seems like a good approach for me is to use the EXPECT functionality. To do this I need TCL and Expect installed? If so, how can I verify I have this installed?

Also, just so I understand. My ksh script will call another script which is my expect script and does what I need it to do right? To invoke it I need to add to the top line # /usr/bin/expect or where ever expect is installed??