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

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

by salva (Monsignor)
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 making s'mores by the fire in the courtyard of the Monastery: (10)
As of 2014-10-25 00:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (138 votes), past polls