in reply to net::ssh::expect net::scp::expect problem

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__