ssh, scp, sftp, sudo, su, and pretty much any sane login system are all specifically designed to
prevent you from using stored, plaintext passwords. That you bludgeon it into working with a third-party hacking tool is a subtle hint, writ in mile-high flashing neon letters, that you're
really not supposed to do this. Unfortunately this isn't just an aesthetic consideration -- they've got good reason to consider retrievably-stored passwords a security nightmare.
If you use ssh keys -- a secure and
noninteractive authentication method -- ssh/scp/sftp won't fight you at all. They'll work as designed directly, with no coercion or third-party utilities necessary: Just the right files in the right places lets you type
ssh hostname /bin/sh < /path/to/scriptfile.sh and watch it go. You'll find tutorials on creating ssh keys plastered all over the internet, and if they give you trouble, we can help. Here's
one of them.