Reg sftp in shell script

Hi,
I want to retrieve files from an sftp site and place it a directory in unix server.
When I try to connect, it is asking password even if i hardcode it in the script.I want to automate the script. Could anyone tell me how to avoid password prompt.

#!/bin/sh
# sample automatic ftp script to dump a file
sftp user@host << EOF
lcd /apps/MFG_BCPSITE/Temp
mget *
quit
EOF

Thanks,
Vidhya

:rolleyes: Have you tried to search forums before posting ?
Seems that they are many threads about sftp and password problems

automate sftp using unix script (
How to give passwd along with sftp.
how to give sftp a password in a shell scripit
SFTP in batch mode
. . .

Jean-Pierre.

Hi,
I did search the forum.But they use SSH-Keygen for authentication,I am using OpenSSH.
keygen command is not working in my unix box.

Thanks.

what is your sftp server os?