Use sshpass with bash. When you can’t get people to use public key authentication with ssh, use sshpass to automate providing a password. The sshpass -f option reads the password from a file which is more secure than having it appear in a command. The scp -q option (sftp has a similar option) prevents Password Authentication: from being emitted (on stderr, I believe) for cron’s sake. When sshpass fails it does so silently, emitting only a non-zero exit status. One case when this happens is when scp or sftp prompt to accept a new host key. sshpass does nothing other than return an exist status of 6 in this case. For cron, it’s helpful to have something written stderr. (See manpages for other sshpass exit statuses.)
sshpass -f "$ssh_passwd_file" \
scp -q "$sub_file" \
"$ssh_user@$ssh_host:$ssh_dir/$ssh_filename" \
|| {
exit_status="$?"
printf "sshpass returned exit status '%s'.\n" "$exit_status" >&2
return "$exit_status"
}