I am writing a script which will take a password as an arg and need to
use that password when for sshing around. For various reasons I cannot
use key based authentication.

However, ssh does not appear to take stdin:
brock at brockwork brock $ echo password | ssh localhost
Pseudo-terminal will not be allocated because stdin is not a terminal.
Password:
-bash: line 1: password: command not found
brock at brockwork brock $

and

brock at brockwork brock $ ssh localhost << END
> password 
> END
Pseudo-terminal will not be allocated because stdin is not a terminal.
Password:

Thus, does anyone know how to give ssh a password in a script?

Thanks