Help for this page

Select Code to Download


  1. or download this
    use Net::SSH::Perl;
    
    ...
    my($out,$err,$ext) = $ssh->cmd("echo LOGINSUCCESSFUL");
    
    print "out=$out err=$err ext=$ext\n";
    
  2. or download this
    % ./test.pl linux-host root password
    Use of uninitialized value in concatenation (.) or string at ./test.pl
    + line 16.
    out=LOGINSUCCESSFUL
     err= ext=0
    
  3. or download this
    % ./test.pl windows-host Administrator password
    Use of uninitialized value in concatenation (.) or string at ./test.pl
    + line 16.
    Use of uninitialized value in concatenation (.) or string at ./test.pl
    + line 16.
    out= err= ext=255
    
  4. or download this
    % ssh -2 root@linux-host "echo LOGINSUCCESFUL"
    root@linux-host's password:
    ...
    % ssh -2 Administrator@windows-host "echo LOGINSUCCESFUL"
    Administrator@windows-host's password:
    LOGINSUCCESFUL