Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: Net::SSH2 Interactive command example

by vdubjunkie (Novice)
on Apr 18, 2008 at 18:21 UTC ( [id://681560]=note: print w/replies, xml ) Need Help??


in reply to Re: Net::SSH2 Interactive command example
in thread Net::SSH2 Interactive command example

For my code to work, I had to insert a line found in another thread on this wonderful site...

$chan2 = $ssh2->channel(); $chan2->blocking(0); print $chan2 "tail -5 /var/log/authlog\n"; print "**$_" while <$chan2>;


Hope this might help somebody else banging their head against the wall as was I.

Replies are listed 'Best First'.
Re^3: Net::SSH2 Interactive command example
by iguanodon (Priest) on Apr 18, 2008 at 19:18 UTC
    Well I didn't have to bang my head too long. I just started trying Net::SSH2 a few minutes ago and hit this problem. So I fire up Super Search and there's my answer. Wonderful site, indeed. Perlmonks rocks. And a big ++ to you, vdubjunkie.

Re^3: Net::SSH2 Interactive command example
by delirium_az (Initiate) on Jul 30, 2008 at 01:00 UTC
    That didn't work for me but this does:
    $chan2 = $ssh2->channel(); $chan2->blocking(0); $chan2->exec("tail -5 /var/log/authlog\n"); print "**$_" while <$chan2>;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2024-04-19 08:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found