[Ssh-sftp-perl-users] Net::SSH::Perl is hanging
Brought to you by:
dbrobins
|
From: Markus <ma...@ni...> - 2006-08-01 12:06:16
|
I try to manage VPN gateway by using SSH, which using a readhat kernel.
During the login process is possible to run in to a dialog which needs to be
answered.
The dialog looks like this:
WARNING: There exist other CLI sessions.
Current sessions (including this session):
Logged on From
Wed Jul 26 11:41 192.168.1.36
Wed Jul 26 11:41 192.168.1.37
Kill other sessions (yes/no) [no]:
It seams that the own scrip is opening a second session from the beginning.
Also is he probably waiting for the prompt.
How ever, on this dialogis hanging my script (line 15: $ssh->shell();). If I
don't use the shell mode than I run in another problem by applying a command
(ERROR: Only interactive login supported).
I need to know:
* how satisfy this dialog?
* suppress the message
IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line
295
IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
Here the scrip output
##################################################################
...
IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 118
WARNING: There exist other CLI sessions.
Current sessions (including this session):
Logged on From
Wed Jul 26 12:57 192.168.1.42
unknown unknown
Kill other sessions (yes/no) [no]: IO::Socket::INET at
C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
##################################################################
Here the test script it self
##################################################################
#!/usr/local/bin/perl
use strict;
use warnings;
use Net::SSH::W32Perl;
STDOUT->autoflush(1);
my $ssh = new Net::SSH::W32Perl('192.168.1.102', debug => 1);
$ssh->login('admin', 'go');
$ssh->shell();
my ($out, $err, $exit) = $ssh->cmd('/inf');
print "OUTPUT: $out\n";
print "ERROR: $err\n";
print "EXIT_code: $exit\n";
##################################################################
thanks
Markus
|