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.