Thread Net::SSH::Perl mit Public Key keine Verbindung (18 answers)
Opened by comp2000 at 2013-01-20 22:29

comp2000
 2013-01-20 22:29
#165072 #165072
User since
2013-01-20
15 Artikel
BenutzerIn
[default_avatar]
Hallo ich brauche dringen mal eure hilfe. Von meinen DebianServer soll meine Fritzbox abgefragt werden und das mit einem Perl Script
In der Konsole geht ssh vom Server zur Fritzbox über SSH Public Key.
Code: (dl )
root@Linuxserver ~ > ssh -t -l root 192.168.2.1 '. ~/.profile;/var/media/ftp/Intenso-RainbowLine-01/MyUtils/LanDeviceActive.pl HP-Laptop'

funktioniert und mit
Code: (dl )
root@Linuxserver ~ > ssh -t -l root 192.168.2.1 echo $?

kann ich die richtige Antwot auch sehen, soweit so gut.
als Perlscript sieht das ganze so aus
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package main;
use strict;
use warnings;
use Net::SSH::Perl;
#Test_FB_abfrage
sub
PersonPresent($) {
my $host = "192.168.2.1";
my $user = "root";
my $landevice = $_[0];
my $ssh2fritzbox = Net::SSH::Perl->new($host, debug=>3, identity_files=>["/root/.ssh/id_rsa"]);
$ssh2fritzbox->login($user);
my($stdout, $stderr, $exit) = $ssh2fritzbox->cmd(". ~/.profile; /var/media/ftp/Intenso-RainbowLine-01/MyUtils/LanDeviceActive.pl $landevice");
Log 3, ">>> $landevice $exit";
return $exit;
}

aber das funktioniert keines wegs sondern bringt mir im log vom Linuxserver folgenes:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Linuxserver: Reading configuration data /root/.ssh/config
Linuxserver: Reading configuration data /etc/ssh_config
Linuxserver: Connecting to 192.168.2.1, port 22.
Linuxserver: Remote protocol version 2.0, remote software version dropbear_0.52
Linuxserver: Net::SSH::Perl Version 1.35, protocol version 2.0.
.inuxserver: No compat match: dropbear_0.52
Linuxserver: Connection established.
Linuxserver: Sent key-exchange init (KEXINIT), wait response.
Linuxserver: Algorithms, c->s: 3des-cbc hmac-sha1 none
Linuxserver: Algorithms, s->c: 3des-cbc hmac-sha1 none
Linuxserver: Entering Diffie-Hellman Group 1 key exchange.
Linuxserver: Sent DH public key, waiting for reply.
Linuxserver: Received host key, type 'ssh-dss'.
Linuxserver: Host '192.168.2.1' is known and matches the host key.
Linuxserver: Computing shared secret key.
Linuxserver: Verifying server signature.
Linuxserver: Waiting for NEWKEYS message.
Linuxserver: Send NEWKEYS.
Linuxserver: Enabling encryption/MAC/compression.
Linuxserver: Sending request for user-authentication service.
Linuxserver: Service accepted: ssh-userauth.
Linuxserver: Trying empty user-authentication request.
Linuxserver: Authentication methods that can continue: publickey,password.
Linuxserver: Next method to try is publickey.
Linuxserver: Trying pubkey authentication with key file '/root/.ssh/id_rsa'
Linuxserver: Will not query passphrase for '/root/.ssh/id_rsa' in batch mode.
Linuxserver: Loading private key failed.
Linuxserver: Next method to try is password.
Linuxserver: Trying password authentication.
Linuxserver: Will not query passphrase in batch mode.
Linuxserver: Authentication methods that can continue: publickey,password.
Linuxserver: Next method to try is publickey.
Linuxserver: Trying pubkey authentication with key file '/root/.ssh/id_rsa'
Linuxserver: Will not query passphrase for '/root/.ssh/id_rsa' in batch mode.
Linuxserver: Loading private key failed.
Linuxserver: Next method to try is password.
Linuxserver: Trying password authentication.
Linuxserver: Will not query passphrase in batch mode.

pfade stimmen alle und werden ja per Konsole auch zur erfolgreichen Verbindung genutz.
Last edited: 2013-01-20 22:47:20 +0100 (CET)

View full thread Net::SSH::Perl mit Public Key keine Verbindung