Help needed in shell script for FTPS


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help needed in shell script for FTPS
# 1  
Old 05-20-2007
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
# 2  
Old 05-20-2007
Install the remote certificate as acceptable locally so sftp finds it locally and trusts it, otherwise you may blithely trust any certificate.
# 3  
Old 05-20-2007
Can u pls tell me how to install the certificate in the local machine?
Im new to this.

Thanks.
# 4  
Old 05-20-2007
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.
# 5  
Old 05-20-2007
You told me another option that I can blithely trust any certificate..
Could you please tell me how to do that?

Thanks
# 6  
Old 05-20-2007
What options are you using so far?

How are you authenticating?

Can you give us the exact sftp line in your script?
# 7  
Old 05-20-2007
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Best way to transfer files to remote FTPS server instead of local FTPS server

Hi, I am working on an application which runs on an Informatica Red-Hat 5.10 Linux Server. The application involves several Informatica ETL workflows which generate 100s of Text files with lot of data. Many of the files will each be up to 5 GB in size. Currently the Informatica server itself... (7 Replies)
Discussion started by: waavman
7 Replies

2. Shell Programming and Scripting

Shell script - help needed

I want to take out the Z1 value from the lscfg outpu and use the below command to get it lscfg -vl hdisk0 | grep "Device Specific.(Z1)" | awk -F. '{print $NF}' # lscfg -vpl hdisk0 . . Device Specific.(Z0)........0000063268181002 Device Specific.(Z1)........020064a . And it works,... (2 Replies)
Discussion started by: moorthikv
2 Replies

3. Shell Programming and Scripting

Shell scripting to transfer files from one to another server through ftps

Hi Guyz ,, I'm an ERP functional guy , I really need to automate a script which required a shell script but have a little knowledge in shell scripting. I need my generated files to be zipped first in one directory lets say (xyz) and then it needs to transfer another ftp server in... (3 Replies)
Discussion started by: Shogundion
3 Replies

4. Shell Programming and Scripting

Help Needed with Shell Script

I need help writing a Unix shell script that does the following: 1) Searches all of the files in a given directory that have the .acl file extension 2) Redirects the output of the search to a column in a .xls or .cvs file (Note: The column name in the spreadsheet file needs to be named... (2 Replies)
Discussion started by: ijmoore
2 Replies

5. Shell Programming and Scripting

FTPS Connection script

I have a requirement for which I had to connect to a server using FTPS. I have been provided with these, connection method: FTPS Server Name Port for explicit and implicit Login user I would like to know the FTPS command/script in order to connect to there server and get a file. ... (5 Replies)
Discussion started by: r@v!7*7@
5 Replies

6. UNIX for Dummies Questions & Answers

Ftps connection by ksh script

Hi, I'm trying to access to FTP SERVER over SSL with this script unix : (credentials are correct) #!/usr/bin/ksh USER="test" PASSWORD="pwdtest" IP="**.***.*.***" ftp -s $IP 990 << EOF >>log_ftp user $USER $PASSWORD bin passive EOF but seems that credentials are not passed... (2 Replies)
Discussion started by: nash83
2 Replies

7. UNIX for Dummies Questions & Answers

Help needed with Shell script

Hi I want a script which should basically do 1. If the size of the file is 0kb, send email to some list od ppl 2. if the size of the file is other than 0kb send email to someother list... Pls help (2 Replies)
Discussion started by: win4luv
2 Replies

8. Shell Programming and Scripting

FTPS Script to move a file to Unix Folder

Dear Experts, I need to connect to a FTPS Server and move the files from FTPS folder "/SAP/Out" to Unix directory "/SAP/In". I need to run this script on Unix directory...Script should get the files from FTPS folder and place that in specified Unix Directory. Thanks In Advance. (1 Reply)
Discussion started by: phani333
1 Replies

9. UNIX for Dummies Questions & Answers

shell script Help Needed!!

Hi guys-- Here is the interesting problem.. I have a folder, which has a couple of xml files like ( could be anywhere under the sub folders) ABCD_NA.xml XAYSGD_SC.xml CBV_CA.xml etc I need to peek in each of these xml's and see that the pattern before the _ and after the _ are there... (0 Replies)
Discussion started by: smallu
0 Replies

10. UNIX for Dummies Questions & Answers

2 ftps in script, second won't go to output file

I'm running this on both solaris and hp boxes, ftping from windows, then ftping to an aix machine. If I run the ftpReportFile by itself, I get info in the ftp_rpt_log. If I run just the 2 ftps together, I also get output. However, if I run the entire shell script, I don't get output from... (4 Replies)
Discussion started by: brdholman
4 Replies
Login or Register to Ask a Question