in reply to sftp connection through perl

First off, you haven't shown us any Perl code for us to see what you are attempting to do.

That said: I have quoted some of the trace that you supplied and in there is the smoking gun so to speak. It would appear that serverB is not in the known_hosts file for the userid that is running the script. Very simple fix:

  1. Log in as the userid that is running the script
  2. SSH from that userid to hostB as the userid SFTP is logging in as.
  3. When SSH asks you to accept the key say "yes."
That will cause the known_hosts file to be populated with the public key of the remote host

Works fine... lasta a long time...


Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg

Replies are listed 'Best First'.
Re^2: sftp connection through perl
by sandeep_car (Novice) on Mar 12, 2013 at 13:17 UTC
    Thanks blue_cowdawg. I tried the same way and it worked.