[Ssh-sftp-perl-users] Using Net::SSH:Perl login()
Brought to you by:
dbrobins
|
From: Moussavi, K. <KMo...@PE...> - 2004-02-02 18:54:30
|
Hello,
We've installed the Net::SSH::Perl module on a Red Hat 9 machine and are
interested in using this module to SSH to several different machines on a
nightly basis. We parse a file and gather passwords/IP addresses then
proceed to connect to the remote machines. We are using the module in the
following manner:
use Net::SSH::Perl;
@lineArray = `/bin/cat $file`;
foreach $line (@lineArray) {
chomp $line;
@tempStringArray = split(/\s+/,$line);
$password = $tempStringArray[3]; # value grabbed from password
file.
$ssh->login("root",$password);
($stdout, $stderr, $exit) = $ssh->cmd("ls -l");
.
.
.
}
Once the script is executed we observe an error message related to DES.pm.
However, this script works if instead of reading the password from a file we
explicitly assign the password string to $password (e.g. $password =
"testpass"). How is it that the latter method works and how can we modify
our script so that we can read password strings from a file rather than
hard-coding passwords in the script?
Much thanks,
Keyvan Moussavi
|