Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
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 surveying the Monastery: (10)
As of 2014-12-26 04:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (165 votes), past polls