SSH issues

Question:

A perl program that was using SSH to run on a remote machine errors out because of an update in the warning message at login. The script interprets the following as STDERR and stops executing.

################################################################################
WARNING THIS IS A PRIVATE AND PROPRIETARY SYSTEM. ANY
UNAUTHORIZED ACCESS TO OR MISUSE OF XX SYSTEMS OR DATA MAY RESULT IN
CIVIL AND/OR CRIMINAL PROSECUTION, EMPLOYEE DISCIPLINE UP TO AND INCLUDING
DISCHARGE, OR THE TERMINATION OF VENDOR/SERVICE CONTRACTS. XX MONITORS THE
ACCESS AND USE OF THIS SYSTEM.
################################################################################

Before they added this message the script was working fine…any ideas?

Solution:

I’m assuming that the ssh_cmd is the part that is failing.  Is this correct?
From the documentation, it doesn’t look like there is any way to handle it if the data appears on STDERR.

You could try the Net::SSH::Perl module, and use the command:
my($stdout, $stderr, $exit) = $ssh->cmd($cmd);
which allows you to run a command, and capture the STDOUT and STDERR seperately.

Or instead of using the ssh_cmd, use sshopen2 (as you are), but then print to WRITER the commands you want to execute.

Tags:
digg delicious stumbleupon technorati Google live facebook Sphinn Mixx newsvine reddit yahoomyweb
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...