I'm baffled by an SFTP shell script and any help would be greatly appreciated. I wrote an sftp script to connect to and upload ACH information to a banking site. The script uses 'expect' to wait for responses from the remote site. The script runs on a RedHat server, release 5.11.
If I run this script from my home directory or my temp directory, the remote host responds to the login with "Password:" and my SFTP script runs normally. If I run this script from a directory dedicated to storing shell scripts that are used by CRON, the remote server responds with "Enter passphrase for key '/prod/apps/xxxxxx/batchjobs/ACRO_privatessh'" and my SFTP script hangs, as the expected response does not match what is sent from the remote server.
All other pieces except the directory from which the script is run, remain equal. This includes permissions, ownership, and the userId that executes the script. Put another way, I can execute the script from our batchjobs directory, where it hangs because the server response is 'wrong'. I can then copy that script to my home directory, and the script executes and completes because the server response is 'right'.
Thanks in advance for any help.