nivarshn 0 Newbie Poster

Hi,I am using following code for FTP in shell script file and it is working.Now I want to migrate from FTP to SFTP.What code changes/steps I have to perform for SFTP ?

ftp -in <<FIN
open $SAP_UP_SERVER
user $SAP_UP_USER $SAP_UP_PASSWORD
asc

put $PM00_OUTPUTS_DIRECTORY/$SAP_UP_FILE_CSV /$SAP_UP_FILE_CSV
put $PM00_OUTPUTS_DIRECTORY/$SAP_UP_FILE_CTL /$SAP_UP_FILE_CTL
prompt ... End File ftp dates transaction

QUIT
FIN

My shell scripts are executing on Unix server and transfering files to window server 2008.There is one scheduled job (via Control-M) on server that is executing shellscript everyday.
so how to setup ssh password less login to avoid using hard-coded passwords ? Can you please give me detailed steps ?

will below code work for SFTP :
sftp user@hostname << EOF
put file1
put file2
EOF

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.