Hi bigswifty00000

Without seeing the code to carry out the scp it's difficult to diagnose why the error you've displayed has occurred.

Re: Uncaught exception from user code: SSHAuthenticationError Login timed out it appears you've timed out before a successful login...

On the server that you're attempting to connect to; what is the LoginGraceTime field set to in your sshd_config file? (It might be a quick fix to simply increase this value, but I wouldn't go that route until we know for sure you can indeed perform a simple user/password authentication connection).

Are you able to achieve a basic login using something like this?

#!/usr/bin/perl use strict; use warnings; use Net::SSH::Expect; # create an SSH connection object with user,password auth my $ssh_conn = Net::SSH::Expect->new( host => '192.168.0.4', # server ip user => 'john', # user password => 'password123', # password raw_pty => 1 ); # use the SSH connection object to attempt a logon to our # SSH server using the local SSH client my $login_session = $ssh_conn->login(); die "Login attempt failed. Output: $login_session\n" if $login_session + !~ /Last login/; # arrival here signifies a successful login print "You are now logged in!\n"; # close the SSH connection $ssh_conn->close(); __END__

In reply to Re: net::ssh::expect net::scp::expect problem by shadowsong
in thread net::ssh::expect net::scp::expect problem by bigswifty00000

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.