Alternative module of Net::SSH::Expect or how to connect remote server and get the output of command

StackOverflow https://stackoverflow.com/questions/2617641

  •  26-09-2019
  •  | 
  •  

Question

I want to use Net::SSH::Expect in my unix box but unfortunately, it is not available and I am not able to convince the admin to install any perl module. Do you know how could I connect to a remote server using expect. I know that I can archive that by using python but python is also not avai in my unix box. Second attempt: though I use expect and shell scripting but the output is missing which is my original problem :Missing output when running system command

Please advise me any alternative module of Net::SSH::Expect so I can check its availibility in my unix box. Or any other way to connect remote server, execute some command and get the output ? Million thanks.

Was it helpful?

Solution

You do not need your system administrator to install a module in order for you to run it. You can download and install it locally, and use local::lib to use it (as discussed in earlier questions on this site).

Alternatively, have you simply tried:

my $output = `ssh username@host command arguments`;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top