I guess ssh access doesn't work passwordlessly either. Your description of the work flow is not too clear nor detailed; you need to make sure the public key created is appended to the target user's ~/.ssh/authorized_keys file on the target host, and both directory and file have the correct permissions (this is a recommendation, not a requirement).
Usually, only one direction is used; on rare occasions only you need the reverse connection.
Did you set up the "target to source" connection the identical way, but source and target mirrored? Please describe the process in full detail - what was done where, what goes where, ...
Incorrect permission for .ssh directory and authorized_keys / authorized_keys2 file
Corrupt key file, regenerate and copy again.
Space,character or line inserted or truncated during appending to existing file. Don�t copy keys manually but do a cat new_keys >> authorized_keys ; For new files copy the file and rename , don�t manually copy paste contents.
Remember that the permissions have to be locked down at both ends so only the owner at the client end ONLY can read the private key and that the userid on the server (target) ONLY can read/write the public key. SSH and other tools that use these keys will check that they are not vulnerable to someone else editing them. You should also check that the directory permissions for .ssh are read/write/execute for the owner ONLY.
Do not allow any other access to these files. The blanket chmod 777 ....... will make prevent you using them. Try chmod 600 ~/.ssh/* and chmod 700 ~/.ssh on both the client and the server.
If it's not any of the above, when you generated the keys I'm wondering if your provided a passphrase. This would require you to enter the passphrase every time to use the keys, so you can't automate it.
It is best practice to have a passphrase for interactive use of the keys. If you wish, you can have multiple keys defined and use the one without a passphrase for automated processing using the -i flag.
I have run across this time and again and it always takes me a while to remember why. Openssh was specifically written to disallow connection if the permissions of .ssh are too open. see Ubuntu's writeup on this
After all your suggestions, I tried to make new setup as I have deleted old keys and .ssh directory.
Now to avoid manual pasting of keys, I can use cat keys >> authorizedkeys as suggested. But I need to paste the keys of source server into target server authorized keys file. and vice versa. To copy like that what command I can use?? while I am using the above command the keys of source server pasting into same server authorized keys.
please suggest.
---------- Post updated at 05:33 AM ---------- Previous update was at 03:00 AM ----------
Even I setup newly, not working properly asking for password again. I checked on permissions too. gave 700 for ssh directory and authorized keys. for both source and target servers. even in one way its not working. please suggest me what I am missing.