Re: [Ssh-sftp-perl-users] help needed for SFTP,SCP keys
Brought to you by:
dbrobins
|
From: Heiko J. <ja...@hb...> - 2008-07-07 11:07:34
|
Am Montag, den 07.07.2008, 02:01 -0700 schrieb Vikas Poonia:
[...]
> i am getting problem only when i try to connect. I am getting the
> error 'unable to connect the remote host' for Scp-Keys my code looks
> like
> 1) my $ssh2 = Net::SSH2->new();
I really hope that there's a step
1a) $ssh2->connect($z_host) or die "Connecting $z_host failed";
> 2) $ssh2->auth_publickey("$z_user", "$publickey" , "$privatekey" ) or
> die "Unable to login to user $z_user host $z_host $@ \n Login user
> $z_user auf Host $@ nicht moeglich! \n";
Looks like some variables got mixed up. That error message should
probably read
-- snip --
die "Unable to login user $z_user on host $z_host: $@ \n Login user
$z_user auf Host $z_host nicht moeglich! \n";
-- / snip --
But of course that can't be the source of the connection problems.
> 3) $ssh2->scp_put(("$f_flam", "$f_ftp") or die "\nKonnte SST-Datei
> $f_flam nicht nach $f_ftp versenden!\n\n";
> where $z_user is name of remote host
I believe you meant "$z_host" here...
> i m getting error on line nos 2 itself.
> can u please suggest me something. do i need to change something in
> place of $z_user etc.
For any helpful advice you should provide more info on which error
messages you get.
Please turn on debug messages with "$ssh->debug(1);".
You could also restart the ssh daemon on the server with a higher log
level and have a look at the logfiles there if you believe that the
problem source might be found there.
Heiko
|