tcampion has asked for the wisdom of the Perl Monks concerning the following question:
Need some help. Trying to use Net::openSSH but running into an error and cant seem to find a solution googling or looking at the docs. I'm able to succesfully log into a jump server with this code but not continue on to the next host. I get the following error. Pseudo-terminal will not be allocated because stdin is not a terminal. I guess my problem is telling Net::openSSh how to act like a terminal. I tried connecting with tty => 1 in the options but that produced the same results for me.
#!/usr/bin/perl -w use strict; use Net::OpenSSH; my $host = 'myhost.com'; my $user = 'myusername'; my $passwd = 'mypassword'; my $ssh = Net::OpenSSH->new($host, user => $user, passwd => $passw +d); $ssh->error and die "Can't ssh to $host: " . $ssh->error; #my @ls = $ssh->capture("ssh myusername\@192.168.1.50"); #$ssh->error and # die "remote ls command failed: " . $ssh->error;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Net::OpenSSH tty error
by salva (Canon) on Jul 12, 2011 at 21:06 UTC | |
by tcampion (Initiate) on Jul 13, 2011 at 18:06 UTC | |
by salva (Canon) on Jul 14, 2011 at 09:26 UTC | |
by tcampion (Initiate) on Jul 14, 2011 at 15:05 UTC | |
by salva (Canon) on Jul 15, 2011 at 06:36 UTC | |
|