Sftp in Batch Mode

Hi,

I am trying to do sftp a file from one server to another solaris server. Both are sftp enabled. I have generated the rsa key in local server and did a ftped the public key to the remote server and added that in the authorization keys file.
Then i try to run the below command using a script , which prompts me to enter the password.
sftp -oIdentityFile=/global/home/localserver/.ssh/authorized_keys -b batch.txt raja@remoteserver

I want to do the sftp using batch mode from local to remote server.

Please help me on this.

what happens when you do a ssh to the remote? does it prompt you for password too? if that's the case, either you have not set SSH keys properly, or you are running the server without public key authentication. check your server config too.

While you are at it, check the perms on the .ssh directory on both servers and the authorized_keys2 on the remote server and the private key on the local server. If StrictModes is set to yes, key-based authentication will not work if there are permissions for anyone except the owner to access these files (files have to be 600, directories have to be 700).