Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] Net::SSH::Perl

Expand Messages
  • Roger
    Thanks. Problem is I don t have root permission to install the module in server A. ... From: merlyn@stonehenge.com Subject: Re: [PBML]
    Message 1 of 13 , Sep 20, 2010
    View Source
    • 0 Attachment
      Thanks. Problem is I don't have root permission to install the module in server A.

      --- On Mon, 9/20/10, merlyn@... <merlyn@...> wrote:

      From: merlyn@... <merlyn@...>
      Subject: Re: [PBML] Net::SSH::Perl
      To: "Roger" <rfbits@...>
      Cc: perl-beginner@yahoogroups.com
      Date: Monday, September 20, 2010, 5:59 PM







       









      >>>>> "Roger" == Roger <rfbits@...> writes:



      Roger> Thanks for your response.

      Roger> I'm running the below code (to connect to host A) from eclipse on my laptop.



      Roger> #!/usr/bin/perl

      Roger>  

      Roger> use Net::SSH::Perl;

      Roger> use strict;



      Roger> my $refHost = "hostA";

      Roger> my $refUser = "userName";

      Roger> my $refPwd = "password!";

      Roger> my $refCmd = "ls -ltr";



      Roger> my $ssh = Net::SSH::Perl->new($refHost);

      Roger> $ssh->login($refUser, $refPwd);

      Roger> my($out, $err, $exit) = $ssh->cmd($refCmd);



      Roger> Now I need to connect to host B from host A. I want to do that

      Roger> from my laptop.



      Yup. Copy that code to HostA, edit it to point at HostB, and make sure

      Net::SSH::Perl is installed there.



      --

      Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095

      <merlyn@...> <URL:http://www.stonehenge.com/merlyn/>

      Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.

      See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion























      [Non-text portions of this message have been removed]
    • merlyn@stonehenge.com
      ... Roger Thanks. Problem is I don t have root permission to install the Roger module in server A. You *never* need root permission to install a Perl module.
      Message 2 of 13 , Sep 20, 2010
      View Source
      • 0 Attachment
        >>>>> "Roger" == Roger <rfbits@...> writes:

        Roger> Thanks. Problem is I don't have root permission to install the
        Roger> module in server A.

        You *never* need root permission to install a Perl module.

        See "perldoc perlmodinstall".

        And now... I'm obligated to include the following public
        service announcement:

        **************************************************
        *
        * THIS IS NOT THE OFFICIAL perl BEGINNERS GROUP.
        *
        * The official one is at beginners@..., with instructions on how to
        * join at http://lists.perl.org/list/beginners.html.
        *
        * You'll get far better response there, not to say you won't get *any* here.
        *
        **************************************************

        --
        Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
        <merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
        Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
        See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
      • off_gl@yahoo.com
        I dont think you are right Merlyn ... Since I also tried to do the same thing and it didn t work for me too. you need to have root permission to install
        Message 3 of 13 , Sep 20, 2010
        View Source
        • 0 Attachment
          I dont think you are right Merlyn ... Since I also tried to do the same thing
          and it didn't work for me too. you need to have root permission to install
          NET::SSH::PERL module at least.


          Roger I would suggest you to use shell script to connect to your laptop from
          remote server..

          And Merlyn this group name also suggest that it is for beginer
          (perl-beginner@yahoogroups.com) if not then it should be changed .. No offense
          but being a learner I am also facing the same issue ....

          For better and interactive mode over ssh connection u can use the piece of code
          given below Roger

          #!/usr/bin/perl -w
          use strict;
          use Net::SSH::Perl;
          my $host = '192.168.0.1';
          my $username = 'user';
          my $login_passwd = 'user123';
          my $ssh = Net::SSH::Perl->new($host, $username);

          $ssh->config->set('interactive', 1)
          unless defined $ssh->config->get('interactive');
          my $cmd;
          $ssh->login($username, $login_passwd);

          if ($cmd) {
          my($out, $err, $exit) = $ssh->cmd($cmd);
          print $out if $out;
          print $err if $err;
          }
          else {
          eval "use Term::ReadKey;";
          ReadMode('raw');
          eval "END { ReadMode('restore') };";
          $ssh->shell;
          print "Connection to $host closed.\n";
          }

          hope this helps ..




          [Non-text portions of this message have been removed]
        • merlyn@stonehenge.com
          ... off I dont think you are right Merlyn ... Since I also tried to do the off same thing and it didn t work for me too. you need to have root off
          Message 4 of 13 , Sep 20, 2010
          View Source
          • 0 Attachment
            >>>>> "off" == off gl <off_gl@...> writes:

            off> I dont think you are right Merlyn ... Since I also tried to do the
            off> same thing and it didn't work for me too. you need to have root
            off> permission to install NET::SSH::PERL module at least.

            Please.
            Read.
            "perldoc perlmodinstall".

            Please.

            Don't say I'm not right without following that.

            {sigh}

            --
            Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
            <merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
            Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
            See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
          • merlyn@stonehenge.com
            ... off And Merlyn this group name also suggest that it is for beginer off (perl-beginner@yahoogroups.com) if not then it should be changed .. No offense
            Message 5 of 13 , Sep 20, 2010
            View Source
            • 0 Attachment
              >>>>> "off" == off gl <off_gl@...> writes:

              off> And Merlyn this group name also suggest that it is for beginer
              off> (perl-beginner@yahoogroups.com) if not then it should be changed .. No offense
              off> but being a learner I am also facing the same issue ....

              This group was created by idiots, who didn't realize there was
              already an official group.

              If I had the power to shut this group down, I would.

              --
              Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
              <merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
              Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
              See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
            • Ralph Blach
              I am using the module Net::SSH::Perl and i have successfully opened a terminal with ssh- shell The only problem is the the shell does not re-size and only
              Message 6 of 13 , Nov 22, 2011
              View Source
              • 0 Attachment
                I am using the module Net::SSH::Perl

                and i have successfully opened a terminal with

                ssh->shell

                The only problem is the the shell does not re-size and only 80x25. How do change this?

                How do I configure ssh->shell so that when I re-size the parent window, the child ssh shell changes.


                Thank

                Chip
              Your message has been successfully submitted and would be delivered to recipients shortly.