Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Net::SSH::Expect::Expect - Cannot interact - Followup

by phillipewu (Initiate)
on Apr 30, 2008 at 23:12 UTC ( [id://683811]=note: print w/replies, xml ) Need Help??


in reply to Re: Module Net::SSH::Expect - Cannot interact
in thread Module Net::SSH::Expect - Cannot interact

Sorry there seems to be a misunderstanding.

The login part works fine.
However when I run $exp->interact I am expecting that I will have an interactive session but I cannot type (human) anything into that window.

Please, any ideas how to fix this?
  • Comment on Net::SSH::Expect::Expect - Cannot interact - Followup

Replies are listed 'Best First'.
Re: Net::SSH::Expect::Expect - Cannot interact - Followup
by Khen1950fx (Canon) on May 01, 2008 at 10:07 UTC
    This worked for me:

    #!/usr/bin/perl use strict; use warnings; use Net::SSH::Expect; my $ssh = Net::SSH::Expect->new( host => 'localhost', user => 'someuser', password => 'somepassword' ); warn "Starting SSH..."; $ssh->run_ssh(); warn "Testing login output..."; my $login_output = $ssh->login(); print " Done", "\n"; my $who = $ssh->exec('who'); print($who); my $exp = 'who'; $exp = $ssh->get_expect(); $exp->interact();

    I guess that my system works fine without disabling the terminal. It may or may not work for you.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-04-19 15:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found