Hello, I have my application running on one server(A). I have planned to move this on new server(B). I have another application(using perl) running on server(C). My application on server C is trying to make sftp connection with new server B but it gives me "BAD MESSAGE RECEIVED" error. But its working properly while making sftp connection with server A. I have installed sftp and also created new user for sftp on new server B. I have also checked sftp protocol version on server A & server B both are same(version 3). From command prompt I can make sftp connection easily from server C to server B but not from application. I am getting following error:
#25089 1363077870.00000 new: This is Net::SFTP::Foreign 1.73 #25089 1363077870.00000 new: Loaded from /usr/local/lib/perl5/site_per +l/5.16.1/Net/SFTP/Foreign.pm #25089 1363077870.00000 new: Running on Perl v5.16.1 for linux #25089 1363077870.00000 new: debug set to -1 #25089 1363077870.00000 new: ~0 is 18446744073709551615 #25089 1363077870.00000 new: Using backend Net::SFTP::Foreign::Backend +::Unix 1.73 #25089 1363077870.00000 _queue_msg: queueing msg len: 5, code:1, id:3 +... [1] 00 00 00 05 01 00 00 00 03 + | ......... #25089 1363077870.00000 _get_msg: waiting for message... [1] #25089 1363077870.00000 _do_io: _do_io connected: 1 #25089 1363077870.00000 _do_io: _do_io select(-,-,-, undef) #25089 1363077870.00000 _do_io: _do_io write queue: 9, syswrite: 9, ma +x: 65536, $!: 00 00 00 05 01 00 00 00 03 + | ......... #25089 1363077870.00000 _do_io: _do_io read sysread: 1, total read: 1, + $!: 0a + | . #25089 1363077870.00000 _do_io: _do_io select(-,-,-, undef) #25089 1363077870.00000 _do_io: _do_io read sysread: 27, total read: 2 +8, $!: 50 6c 65 61 73 65 20 74 79 70 65 20 27 79 65 73 27 20 6f 72 20 27 6e 6 +f 27 3a 20 | Please type 'yes' or 'no': #25089 1363077870.00000 _set_status: _set_status code: 5, str: Bad mes +sage #25089 1363077870.00000 _set_error: _set_err code: 13, str: bad remote + message received #25089 1363077870.00000 _conn_lost: _conn_lost bad remote message receivedunable to establish SSH connection: bad rem +ote message received at SftpProcess.pm line 205. #25089 1363077870.00000 DESTROY: Net::SFTP::Foreign=HASH(0x41088f0)->D +ESTROY called (current pid: 25089, disconnect_by_pid: ) #25089 1363077870.00000 disconnect: Net::SFTP::Foreign=HASH(0x41088f0) +->disconnect called (ssh pid: ) #25089 1363077870.00000 _conn_lost: _conn_lost
Kindly help me out. Thanks

In reply to sftp connection through perl by sandeep_car

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.