SSH : File transfer

We have tow servers.One Linux server (A) and one unix server (B).
How can i set up so that files can be sftped from A to B.

Please let me know the steps

connect both hosts manually to each other using ssh so both are 'known_hosts' to each other.Then write a small script to sftp files.

i am getting the below error

Host key verification failed
Couldn't read packet: Connection reset by peer

paste the o/p of ssh command you used...

My guess is your versions of SSH are different on those systems. Even if the known_hosts file is correct on both systems, you'll still get that error if your keys do not sync.

What version of Unix and Linux are you using?