Use sftp in scripts to transfer data from mainframe to Solaris

Hi,

I have a situation where in we have created shell scripts to transfer data from/to mainframe and Solaris. The scripts uses ftp commands line commands(get or put) to perform the task. Now due to security reasons, ftp will not be allowed and sftp will be used. Can anyone let me know what is the equivalent sftp commands for the following ftp commands:

  1. ftp <ip address> - This is used to connect to mainframe
  2. after it connects it prompts for userid and password (not sure what happens in sftp
  3. at ftp prompt i can issue ls command to get a directory listing, cd command to change the directory.
  4. get command to download the file and put command to upload data to mainframe from solaris.

I would appreciate if anyone can let me know the equivalent commands in sftp for the ones mentioned above.

Thank you.
bornon2303

  1. man sftp
  2. sftp hostname... but you should not use it from automated mode
  3. man scp
  4. man ssh
  5. mkdir ~/.ssh ; man ssh|grep authorized_keys
  6. If you have used ftp then it seems that you are not aware that something might be insecure... Are you using telnet as well? Let me google that for you
  7. Maybe you might use NFS?
  8. Imagine the following: You have started ftp then something went wrong - but you have provided all the commands to ftp. Instead of "rm -rf my_file" you have executed "rm -rf /". Not possible? I think that it is quite possible...