How to run sftp in shell script without prompting for password?

Hi,

Can anyone tell me how to pass password in a shell script for sftp so that i can run it in background without user entering the password?
I used a expect script but it timesout after some time and the process remains incomplete at the end.
Can anyone suggest any other idea?

Will the below mechanism work properly?

sftp -b /dev/stdin user@server <<EOF
    password
    sftp commands
EOF

Setup SSH keys for password-less logins?

It is for temporary purpose so actually i dnt want to set up password less ssh. Can you suggest somethig in which i can pass the password in the script.

Quite rightly, sftp is designed not to generally accept this. Using ssh-keys is the way to go. They can always be removed afterwards just as easily.

Robin