ssh->login zum Zweiten (anderes Problem)
Posted: 2006-11-22 18:30
Hallo,
mit meinem alten Thema zu ssh login konnte wohl keiner so richtig was anfangen, hab es doch noch etwas unsauber hingekriegt. Egal, viel wichtiger ist meine aktuelle Frage zu ssh-> login:
In meinem Perlskript stelle ich ganz normal eine Verbindung mit ssh->login("root","su"); ein, das funktioniert auch, wenn ich nun aber "su" mit einer Varible ersetze, die das richtige Passwort enthält, ersetze, funktioniert es nicht mehr, in der "error.log" des Apache finden sich folgende Zeilen:
[Wed Nov 22 16:54:51 2006] [error] [client 127.0.0.2] kiste: Trying password authentication., referer: http://127.0.0.2/
[Wed Nov 22 16:54:51 2006] [error] [client 127.0.0.2] kiste: Authentication methods that can continue: publickey,password., referer: http://127.0.0.2/
[Wed Nov 22 16:54:51 2006] [error] [client 127.0.0.2] kiste: Next method to try is publickey., referer: http://127.0.0.2/
[Wed Nov 22 16:54:51 2006] [error] [client 127.0.0.2] kiste: Next method to try is password., referer: http://127.0.0.2/
[Wed Nov 22 16:54:51 2006] [error] [client 127.0.0.2] kiste: Trying password authentication., referer: http://127.0.0.2/
[Wed Nov 22 16:54:52 2006] [error] [client 127.0.0.2] kiste: Authentication methods that can continue: publickey,password., referer: http://127.0.0.2/
[Wed Nov 22 16:54:52 2006] [error] [client 127.0.0.2] kiste: Next method to try is publickey., referer: http://127.0.0.2/
[Wed Nov 22 16:54:52 2006] [error] [client 127.0.0.2] kiste: Next method to try is password., referer: http://127.0.0.2/
[Wed Nov 22 16:54:52 2006] [error] [client 127.0.0.2] kiste: Trying password authentication., referer: http://127.0.0.2/
[Wed Nov 22 16:54:52 2006] [error] [client 127.0.0.2] kiste: Authentication methods that can continue: publickey,password., referer: http://127.0.0.2/
[Wed Nov 22 16:54:52 2006] [error] [client 127.0.0.2] kiste: Next method to try is publickey., referer: http://127.0.0.2/
[Wed Nov 22 16:54:52 2006] [error] [client 127.0.0.2] kiste: Next method to try is password., referer: http://127.0.0.2/
[Wed Nov 22 16:54:52 2006] [error] [client 127.0.0.2] Permission denied at telnetsshneu.pl line 69, referer: http://127.0.0.2/
In Zeile 69 befindet sich das ssh->login mit der Variable: "ssh->login("root", $passwd);"
Habe den Inhalt der Variable auch mit "print "$passwdn";" überprüft, das Passwort stimmt!
Die entscheidenden Zeilen im Skript:
...
$passwd = `pwgen -1`;
my $ssh = Net::SSH::Perl->new($line, debug => 1, protocol => 2);
$ssh->login("root", $passwd);
...
Also, warum funktioniert der Login mit dem Passwort als Klartext und nicht mit dem Passwort als Variable?
Danke schonmal,
Gruß Pascal
mit meinem alten Thema zu ssh login konnte wohl keiner so richtig was anfangen, hab es doch noch etwas unsauber hingekriegt. Egal, viel wichtiger ist meine aktuelle Frage zu ssh-> login:
In meinem Perlskript stelle ich ganz normal eine Verbindung mit ssh->login("root","su"); ein, das funktioniert auch, wenn ich nun aber "su" mit einer Varible ersetze, die das richtige Passwort enthält, ersetze, funktioniert es nicht mehr, in der "error.log" des Apache finden sich folgende Zeilen:
[Wed Nov 22 16:54:51 2006] [error] [client 127.0.0.2] kiste: Trying password authentication., referer: http://127.0.0.2/
[Wed Nov 22 16:54:51 2006] [error] [client 127.0.0.2] kiste: Authentication methods that can continue: publickey,password., referer: http://127.0.0.2/
[Wed Nov 22 16:54:51 2006] [error] [client 127.0.0.2] kiste: Next method to try is publickey., referer: http://127.0.0.2/
[Wed Nov 22 16:54:51 2006] [error] [client 127.0.0.2] kiste: Next method to try is password., referer: http://127.0.0.2/
[Wed Nov 22 16:54:51 2006] [error] [client 127.0.0.2] kiste: Trying password authentication., referer: http://127.0.0.2/
[Wed Nov 22 16:54:52 2006] [error] [client 127.0.0.2] kiste: Authentication methods that can continue: publickey,password., referer: http://127.0.0.2/
[Wed Nov 22 16:54:52 2006] [error] [client 127.0.0.2] kiste: Next method to try is publickey., referer: http://127.0.0.2/
[Wed Nov 22 16:54:52 2006] [error] [client 127.0.0.2] kiste: Next method to try is password., referer: http://127.0.0.2/
[Wed Nov 22 16:54:52 2006] [error] [client 127.0.0.2] kiste: Trying password authentication., referer: http://127.0.0.2/
[Wed Nov 22 16:54:52 2006] [error] [client 127.0.0.2] kiste: Authentication methods that can continue: publickey,password., referer: http://127.0.0.2/
[Wed Nov 22 16:54:52 2006] [error] [client 127.0.0.2] kiste: Next method to try is publickey., referer: http://127.0.0.2/
[Wed Nov 22 16:54:52 2006] [error] [client 127.0.0.2] kiste: Next method to try is password., referer: http://127.0.0.2/
[Wed Nov 22 16:54:52 2006] [error] [client 127.0.0.2] Permission denied at telnetsshneu.pl line 69, referer: http://127.0.0.2/
In Zeile 69 befindet sich das ssh->login mit der Variable: "ssh->login("root", $passwd);"
Habe den Inhalt der Variable auch mit "print "$passwdn";" überprüft, das Passwort stimmt!
Die entscheidenden Zeilen im Skript:
...
$passwd = `pwgen -1`;
my $ssh = Net::SSH::Perl->new($line, debug => 1, protocol => 2);
$ssh->login("root", $passwd);
...
Also, warum funktioniert der Login mit dem Passwort als Klartext und nicht mit dem Passwort als Variable?
Danke schonmal,
Gruß Pascal