#! /usr/local/bin/perl -w use strict; use Net::SSH::Perl; #my $host="192.168.10.32";## remote host IP address my $host="netli01"; ##remote hostname my $usr="venkatas"; ##user login ID my $pass="banu84"; ## user login password ###### set-up remote connection my $ssh = Net::SSH::Perl->new($host, interactive=> 0, debug=> 1, protocol=> '2,1'); #my $ssh = Net::SSH::Perl->new($host, interactive=> 1, debug=> 1, protocol=> '2,1'); ## This stderr and stdout will help to findout whether the commands are executing or not $ssh->register_handler("stderr", sub { my($channel, $buffer) = @_; print "** Standard Error - I received this:\n", $buffer->bytes; }); # This trigger works perfectly $ssh->register_handler("stdout", sub { my($channel, $buffer) = @_; print "** Standard Out - I received this:\n", $buffer->bytes; }); ## remote login authentication $ssh->login($usr,$pass); #$ssh->login(); #my $job2 = $ssh->cmd("set_calico_C1" ); #my $job3 = $ssh->cmd("calico" ); #my $job4 = $ssh->cmd("date" ); #my $job2 = $ssh->cmd('setenv DISPLAY linux37:0'); #my $job3 = $ssh->cmd("bsub -q linux64_idc_1g xterm & " ); ## commands to be executed on remote host my $job1 = $ssh->cmd(<s: 3des-cbc hmac-sha1 none linux37: Algorithms, s->c: 3des-cbc hmac-sha1 none linux37: Entering Diffie-Hellman Group 1 key exchange. linux37: Sent DH public key, waiting for reply. linux37: Received host key, type 'ssh-dss'. linux37: Host 'netli01' is known and matches the host key. linux37: Computing shared secret key. linux37: Verifying server signature. linux37: Waiting for NEWKEYS message. linux37: Send NEWKEYS. linux37: Enabling encryption/MAC/compression. linux37: Sending request for user-authentication service. linux37: Service accepted: ssh-userauth. linux37: Trying empty user-authentication request. linux37: Authentication methods that can continue: publickey,gssapi-with-mic,password. linux37: Next method to try is publickey. linux37: Next method to try is password. linux37: Trying password authentication. linux37: Login completed, opening dummy shell channel. linux37: channel 0: new [client-session] linux37: Requesting channel_open for channel 0. linux37: channel 0: open confirm rwindow 0 rmax 32768 linux37: Got channel open confirmation, requesting shell. linux37: Requesting service shell on channel 0. linux37: channel 1: new [client-session] linux37: Requesting channel_open for channel 1. linux37: Entering interactive session. linux37: Sending command: source /home/venkatas/.cshrc; setenv DISPLAY linux37:0; /usr/local/lsf7.0/7.0/linux2.6-glibc2.3-x86/bin/bsub -q linux64_idc_1g xterm linux37: Sending command: source /home/venkatas/.cshrc; setenv DISPLAY linux37:0; /usr/local/lsf7.0/7.0/linux2.6-glibc2.3-x86/bin/bsub -q linux64_idc_1g xterm linux37: Requesting service exec on channel 1. linux37: channel 1: open confirm rwindow 0 rmax 32768 ** Standard Error - I received this: LD_LIBRARY_PATH: Undefined variable. ** Standard Error - I received this: LD_LIBRARY_PATH: Undefined variable. ** Standard Error - I received this: linux37: channel 1: rcvd eof linux37: channel 1: output open -> drain linux37: input_channel_request: rtype exit-status reply 0 linux37: channel 1: rcvd close linux37: channel 1: input open -> closed linux37: channel 1: close_read lsb_init: ** Standard Error - I received this: Failed in an LSF library call: Unable to open file lsf.conf. Job not submitted. linux37: channel 1: obuf empty linux37: channel 1: output drain -> closed linux37: channel 1: close_write linux37: channel 1: send close linux37: channel 1: full closed