Help needed in shell script for FTPS

Hi,
Im trying to build a script to download files from a secure FTP site.

When I run the command ftps <host_address> in the unix prompt, it asks username and password, and then prompts the following question.
Do you want to trust this certificate? [y|n|a](y):
From the prompt, I am able to type 'y'(Yes) and then it is connecting to the FTP site without any issue.

When i run the shell script which contains the same command (ftps <host_address>), it prompts the same question. Since I am not able to enter during execution of the script, it says 'Connection aborted' and then comes out of the program.

Could anyone tell me how to avoid this prompt
or
How to enter 'y' during execution, Do i need to pass it as an argument in the command line?

Thanks,
Vidhya

Install the remote certificate as acceptable locally so sftp finds it locally and trusts it, otherwise you may blithely trust any certificate.

Can u pls tell me how to install the certificate in the local machine?
Im new to this.

Thanks.

Is it an actual certificate or an entry to known hosts that it is complaining about?

Have a read of this... SFTP

I would expect that you need an entry in your .ssh/known_hosts for the server and the server needs your public key in it's .ssh/authorized_keys for the user you want to log in as. You would also need to provide a non-password protected private key to the sftp client.

You told me another option that I can blithely trust any certificate..
Could you please tell me how to do that?

Thanks

What options are you using so far?

How are you authenticating?

Can you give us the exact sftp line in your script?

Im not using any options.

Below is my shell script.

#!/bin/sh
# sample automatic ftp script to dump a file
ftps 216.93.167.158 <<EOF
user $user $pwd
EOF

When I try the above command from the unixbox it is working fine.

$ ftps 216.93.167.158
Glub Tech Secure FTP v2.5.12
Copyright (c) 1999-2007 Glub Tech, Inc.
Licensed for non-commercial use.
Generating the random seed... done.
Attempting to make an implicit SSL connection to 216.93.167.158 on port 990.
Connection failed.
Attempting to make an explicit SSL connection to 216.93.167.158 on port 21.
220-Glub Tech Secure FTP Wrapper (v2.5.9.1)
220 Microsoft FTP Service
AUTH TLS
234 AUTH Command OK. Initializing SSL connection.
Name (216.93.167.158:vigovind): mfg1
New certifcate encountered:
Issued by: BCMexperts, Secure FTP Wrapper, supplierbcp.com
Issued to: BCMexperts, Secure FTP Wrapper, supplierbcp.com
Do you want to trust this certificate? [y|n|a](y): a
USER mfg1
331 Password required for mfg1.
Password:
PASS **********
230 User mfg1 logged in.

Thanks.

This looks like some whacky Java SFTP client.

I suggest you look at their documentation, eg

question about certificates

GLUB ftps forum

Thanks...It worked...

Vidhya

Can you give a brief summary of what you had to do to fix it?

It tidies up the thread by giving it a more formal conclusion and helps those who come later search for answers better.

Hi,
I have edited the ftps.bat file present in c:\program files\secure ftp 2.5 and added the below condition after "java"

-Dglub.security.override=true

After that I did not prompt me any question.

I got this by posting the same question in glub.com forum, where I downloaded the secure FTP client.

Thanks for your help..

Rgds,
Vidhya