I&#39;m a bit new to perl and am having a bit of trouble getting a sudo (or su for that matter) to work through Net::SSH::Perl.<br><br>Interactive
with a shell doesn&#39;t seem to do anything for me.&nbsp; And I&#39;d like to not
have to fuss with the sudoers to turn off the requiretty.
<br><br><br>Snippets of my code utilizing it...<br><br>#!/usr/bin/perl -w<br>#---------------Includes------<div id="mb_0">----------<br>use strict;<br>use warnings;<br>#use Getopt::Std;<br>use Net::SSH::Perl;<br>use Term::ReadKey;
<br>use Getopt::Long;
<br><br>....<br><br>my $cmd = &quot;sudo test&quot;;<br>my $ssh =
Net::SSH::Perl-&gt;new($hos, interactive =&gt;1, use_pty =&gt; 1, debug
=&gt; 1, port =&gt; $port, protocol =&gt; &#39;2,1&#39;, options =&gt;
[&quot;BatchMode yes&quot;]) or die(&quot;Could not connect&quot;);
<br><br>#$ssh-&gt;login($user, $pass);<br>$ssh-&gt;login($user);<br>#$ssh-&gt;shell;<br>my ($stdout, $stderr, $exit) = $ssh-&gt;cmd($cmd);<br>print &quot;OUT:$stdout \nERR:$stderr \nEXIT:$exit \n&quot;;<br><br>....<br>Response from a sudo test
<br><br>Use of uninitialized value in concatenation (.) or string at ./SerialPush.pl line 79.<br>OUT: <br>ERR:sudo: sorry, you must have a tty to run sudo<br>&nbsp;<br>EXIT:1 <br><br>...<br>Response from a su root test<br><br>

Use of uninitialized value in concatenation (.) or string at ./SerialPush.pl line 79.<br>OUT: <br>ERR:standard in must be a tty<br>&nbsp;<br>EXIT:1 <br><br><br>Any ideas on how I can get this to work?<br>What
I&#39;m trying to do is get a perl script to move a file from tmp to etc,
or just simply write a&nbsp; config file to /etc on a ton of remote systems.
</div>