Posted on 2008-06-27 01:19:03-07 by hcaley
unable to connect to SuSE 9 host
This simple script works fine with RedHat 4. On SuSE 9 it prompts me for a password.
#!/usr/bin/perl -w $user = 'root'; $pass = 'password'; $host = 'ts2'; $cmd = 'ps aux |grep -v grep |grep das'; use Net::SSH::Perl; my $ssh = Net::SSH::Perl->new($host); $ssh->login($user, $pass); my($stdout, $stderr, $exit) = $ssh->cmd($cmd); if ( $stdout ) { print "stdout is $stdout\n"; }; if ( $stderr ) { print "stderror is $stderr\n"; }; if ( $exit ) { print "exit is $exit\n"; };
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.