Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: tty Problem while executing command's with sudo over Net::SSH2

by salva (Abbot)
on Dec 07, 2011 at 07:50 UTC ( #942175=note: print w/ replies, xml ) Need Help??


in reply to tty Problem while executing command's with sudo over Net::SSH2

I guess you have to call the pty method on the $chan to get a pseudo tty allocated on the remote side.

Also, as it seems that you are on a Unix/Linux system, you may like to use Net::OpenSSH instead of Net::SSH2:

my $ssh = Net::OpenSSH->new($host, user => $user, password => $passwor +d); $ssh->error and die "SSH connection failed: " . $ssh->error; $ssh->system({tty => 1}, $ARGV[0]) or die "remote command failed: ". $ssh->error;


Comment on Re: tty Problem while executing command's with sudo over Net::SSH2
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2014-12-25 19:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (162 votes), past polls