Hi all,
i have the following problem with the following script:
#!/usr/bin/perl -w # $Id: cmd.pl,v 1.4 2001/02/22 00:14:48 btrott Exp $
use strict;
use Net::SSH::Perl; use Net::SSH::Perl::Cipher;
chomp(my $this_host = `hostname`); print "Enter a host name to connect to: [$this_host] "; chomp(my $host = <STDIN>); print "\n";
print "Enter the port number of the remote sshd: [ssh] "; chomp(my $port = <STDIN>); print "\n";
print "Choose a cipher from the list:\n"; my $supp = Net::SSH::Perl::Cipher::supported(); for my $ciph (sort @$supp) { printf " [%d] %s\n", $ciph, Net::SSH::Perl::Cipher::name($ciph); } printf "Enter a number: [%d] ", Net::SSH::Perl::Cipher::id('IDEA'); chomp(my $c = <STDIN>); print "\n"; my $ssh = Net::SSH::Perl->new($host || $this_host, port => $port || 'ssh', cipher => Net::SSH::Perl::Cipher::name($c), debug => 1);
my $this_user = scalar getpwuid($<); print "Enter your username on that host: [$this_user] "; chomp(my $user = <STDIN>);
use Term::ReadKey;
print "And your password: "; ReadMode('noecho'); chomp(my $pass = ReadLine(0)); ReadMode('restore'); print "\n";
$ssh->login($user || $this_user, $pass);
print "Enter a command to execute: [ls -l] "; chomp(my $cmd = <STDIN>);
my($out, $err) = $ssh->cmd($cmd || "ls -l"); print $out;
each time i run the script it gets me the error that the input into the crypt-module must be 8 byte long.when i replace the $cmd with a plain command e.g.: "ls -l" it works.Pls help me out.ThxRudi
What is the exact error given? Does it happen for different 'cipher's? You don't check for a successful login, are you sure a connection has been established? You have debugging turned on, can you give us the output from it?
http://danconia.org
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]