in reply to Issue in SFTP connection using Net::SFTP::Foreign-

Enable debugging on Net::SFTP::Foreign and post here the output:
$Net::SFTP::Foreign::debug = -1;

Replies are listed 'Best First'.
Re^2: Issue in SFTP connection using Net::SFTP::Foreign-
by iit2011101 (Novice) on Jun 21, 2016 at 11:03 UTC
    Hi salva. Thanks for looking into it here is the log
    #12546 1466506866.00000 new: This is Net::SFTP::Foreign 1.73 #12546 1466506866.00000 new: Loaded from /export/fds/Linux_RHEL6_x86_6 +4/lang/perl/FDSperl5.12-CPANmodules-5.12-20160408/lib/perl5/Net/SFTP/ +Foreign.pm #12546 1466506866.00000 new: Running on Perl v5.12.5 for linux #12546 1466506866.00000 new: debug set to -1 #12546 1466506866.00000 new: ~0 is 18446744073709551615 #12546 1466506866.00000 new: Using backend Net::SFTP::Foreign::Backend +::Unix 1.73 #12546 1466506866.00000 _init_transport: ssh cmd: ssh -i /home/fds/apf +h/FDSnse_fh/etc/id_rsa -p 6010 -o NumberOfPasswordPrompts=1 -l FASEMD + -o PreferredAuthentications publickey 121.241.2.65 -s sftp #12546 1466506866.00000 _init_transport: starting password authenticat +ion #12546 1466506866.00000 _init_transport: waiting for data from the pty + to become available #12546 1466506867.00000 _init_transport: waiting for data from the pty + to become available "NOTICE TO USERS" "The system is to be used for AUTHORIZED business purpose +only. All activities on this system are being monitored. Unauthorize +d access to this system may be subject to legal action,and/or pros +ecution" #12546 1466506868.00000 _init_transport: waiting for data from the pty + to become available #12546 1466506869.00000 _init_transport: waiting for data from the pty + to become available #12546 1466506870.00000 _init_transport: waiting for data from the pty + to become available #12546 1466506871.00000 _init_transport: waiting for data from the pty + to become available #12546 1466506872.00000 _init_transport: waiting for data from the pty + to become available #12546 1466506873.00000 _init_transport: waiting for data from the pty + to become available #12546 1466506874.00000 _init_transport: waiting for data from the pty + to become available #12546 1466506875.00000 _init_transport: waiting for data from the pty + to become available #12546 1466506876.00000 _init_transport: waiting for data from the pty + to become available #12546 1466506877.00000 _init_transport: waiting for data from the pty + to become available #12546 1466506878.00000 _init_transport: waiting for data from the pty + to become available Connection to 121.241.2.65 closed by remote host.^M #12546 1466506899.00000 _conn_lost: _conn_lost #12546 1466506899.00000 _set_status: _set_status code: 6, str: No conn +ection #12546 1466506899.00000 _set_error: _set_err code: 37, str: SSH slave +exited unexpectedly with error code 255
      First thing you should do is to remove the -o => 'PreferredAuthentications publickey' part that is not really required and may interfere with Net::SFTP::Internals... unless you have some reason to include it!

      Do you know the vendor and version of the remote software? you can just telnet the server at port 22 and it will tell you.

        I have tried without -o => 'PreferredAuthentications publickey' this too. It was not working. I did telnet. -> telnet 121.241.2.65 22 Its showing this Telnet: connect to address 121.241.2.65: Connection timed out although when i used the port provided by the vendor I got this output Trying 121.241.2.65... Connected to 121.241.2.65. Escape character is '^]'. SSH-2.0-OpenSSH_5.3 Connection closed by foreign host.