[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AW: ssl ftp



What do you need for sftp in batch job?

Download the Redpaper from ibm.redbooks

http://www.redbooks.ibm.com/abstract...4163.html?Open

1. Install the license program
2. Generate the key pair
3. Transfer the public key
4. Create a script file
5. Create the CL batch program
6. Submit Job (SBMJOB) CL command


Important: If you set up the sshd (server) environment and establish an SSH session with your user profile for the first time, you see the following message indicating that the host key verification failed. The remote system's public key is not known on the source
system.
When you answer "yes", the remote systems public key is permanently added to your known_hosts file on the source system in the .ssh directory in the user's home directory.


User = lvsftp
Remote server = company.com
Script file = todo.txt 
mget *.txt /home/lvsftp
exit
CL Program = sftp1c

/* ************************************************** *********** */
/* Program : SFTP1 */
/* Function : CL program to transfer all txt files
/* from remote system 
/* to IFS the OpenSSH utility sftp 
/* Written by : Ridvan Filiz / Switzerland
/************************************************** **************/

PGM 

CALL PGM(QP2SHELL) + 
PARM('/QOpenSys/usr/bin/-sh' '-c' + 
'sftp -b /home/lvsftp/shell/todo.txt + 
-o "IdentityFile=/home/lvsftp/.ssh/id_rsa" + 
sfxp.lvsftp@xxxxxxxxxxx') 

ENDPGM 



You can then submit this program to batch by using the Submit Job (SBMJOB) CL command.

Ridvan Filiz 

-----Ursprüngliche Nachricht-----
Von: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] Im Auftrag von Porterfield, Sean
Gesendet: Montag, 4. Februar 2008 21:36
An: HTTPAPI and FTPAPI Projects
Betreff: RE: ssl ftp

Hi, Scott.  This question may not be entirely on topic here, but since you mentioned the idea, I'll ask.

> Note that I do not recommend SSL FTP.  It's a real bear to get SSL FTP 
> to work through the ubiquitous NAT gateways out there, and this makes 
> SSL FTP a real headache.  If you have any say in the matter (...and I 
> realize that you may not...) consider using sftp (the FTP-like 
> interface to SSH) instead of SSL FTP.  It works much better, IMHO.

Do you have anything useful for working with sftp from RPG?  So far all I've had to do was download everything in the directory from a bank, so I just run a Pase shell script to do the sftp.  I can then use the IFS APIs to see what I got and do whatever I need to them.

The next project I have will be slightly more advanced, and it would be great to have more information about what is happening.  I need to know if there are files or not.  I need to delete files after I download them.  Other things that would be better suited to an intelligent program than a blind script.

Thanks.
--
Sean Porterfield

This email is confidential, intended only for the named recipient(s) above and may contain information that is privileged.  If you have received this message in error or are not the named recipient(s), please notify the sender immediately and delete this email message from your computer as any and all unauthorized distribution or use of this message is strictly prohibited.  Thank you.
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------