Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Net::SSH::Expect problem

by Khen1950fx (Canon)
on Mar 20, 2013 at 22:47 UTC ( #1024628=note: print w/ replies, xml ) Need Help??


in reply to Net::SSH::Expect problem

Here's what worked for me:

#!/usr/bin/perl use strict; use warnings; use Net::SSH::Expect; my $host = '127.0.0.1'; my $pass = 'password'; my $user = 'user'; my $cmd = "ls -l /"; my $ssh = Net::SSH::Expect->new( host => $host, password => $pass, user => $user, timeout => 5, raw_pty => 1, log_stdout => 1, ); $ssh->login(); $ssh->exec("$cmd ."); $ssh->close;


Comment on Re: Net::SSH::Expect problem
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1024628]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (14)
As of 2015-07-07 18:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls