Probleme mit Net::SSH::PPerl

Hallo zusammen.

Seid einiger Zeit versuche ich nun eine SSH Verbindung mit Net::SSH::perl
aufzubauen und so langsam verzweifele ich!

Das Problem besteht darin das ich zwar eine SSH Verbindung aufbauen kann, allerdings nur wenn ich das Password interactive über die Tastaur eingeben.


#!/usr/bin/perl

use Net::SSH::perl;

$user = "foo";
$pass = "xxx";

$ssh = Net::SSH::perl->new('172.16.1.85',debug => 1,options=>[ "BatchMode yes"], protocol=>'2,1' );
$ssh->login($user,$pass);

($stdout, $stderr, $exit) = $ssh->cmd("ls");

print $stdout;
print $stderr;
print $exit;

exit;

Gibt folgendes aus:

linux: Reading configuration data /home/foo/.ssh/config
linux: Reading configuration data /etc/ssh_config
linux: Connecting to 172.16.1.85, port 22.
linux: Remote protocol version 1.99, remote software version OpenSSH_3.8p1
linux: Net::SSH::perl Version 1.25, protocol version 2.0.
linux: No compat match: OpenSSH_3.8p1.
linux: Connection established.
linux: Sent key-exchange init (KEXINIT), wait response.
linux: Algorithms, c->s: 3des-cbc hmac-sha1 none
linux: Algorithms, s->c: 3des-cbc hmac-sha1 none
linux: Entering Diffie-Hellman Group 1 key exchange.
linux: Sent DH public key, waiting for reply.
linux: Received host key, type 'ssh-dss'.
linux: Host '172.16.1.85' is known and matches the host key.
linux: Computing shared secret key.
linux: Verifying server signature.
linux: Waiting for NEWKEYS message.
linux: Enabling incoming encryption/MAC/compression.
linux: Send NEWKEYS, enable outgoing encryption/MAC/compression.
linux: Sending request for user-authentication service.
linux: Service accepted: ssh-userauth.
linux: Trying empty user-authentication request.
linux: Authentication methods that can continue: publickey,keyboard-interactive.
linux: Next method to try is publickey.
Permission denied at ./perl-ssh line 10

Wenn ich allerdings im Script den Wert "BatchMode no" setze und das Passwort interactive eingeben funktioniert es.

Ich hoffe es gibt hier jemanden der weiß woran es liegen könnte.
 

Neue Beiträge

Zurück