I am attempting to run the following automated sh program (non-interactive). The requirement is to read/enter the sftp password from a secure dataset and not setup public/private keypairs. When I run the shell it prompts me for the password. Once I enter the password it completes the sftp. How can I get this to run without being prompted for the password?
#! /bin/sh
coz_bin="/etc/coz/bin"
remoteuser="user"
server="remoteserver"
remotefile="/user/tofile"
localdsn="//FB.LOCALDSN"
export PASSWD_DSN="//FB.PWDSN" # contains the sftp password
export SSH_ASKPASS=$coz_bin/read_passwd_dsn.sh
export DISPLAY=none
export SSH_TTY=/dev/null
ssh_opts="-oBatchMode=no"
ssh_opts="$ssh_opts -oConnectTimeout=60"
ssh_opts="$ssh_opts -oServerAliveInterval=60"
ssh_opts="$ssh_opts -oStrictHostKeyChecking=no"
$coz_bin/cozsftp $ssh_opts -b- $remoteuser@$server <<EOB
put $localdsn $remotefile
quit
EOB
