Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Ok I am a bit closer. I know that !bash ran correctly in the remote session because while it was sitting there I typed the pwd and received the correct result. I guess now I am confused as to why the program is waiting on me to interact with it instead of continuing to run the other commands. Current code below

-bash-4.1$ ./test1.pl # open_ex: ['ssh','-O','check','-T','-S','/home/kburns/.libnet-openssh +-perl/kburns-10.10.10.-20023-380016','-l','kburns','10.10.10.1','--'] # _waitpid(20025) => pid: 20025, rc: # open_ex: ['ssh','-S','/home/kburns/.libnet-openssh-perl/kburns-10.10 +.10.-20023-380016','-l','kburns','10.10.10.1','--','!bash']

I typed pwd and it worked so I know !bash ran correctly on the remote end.

pwd
/home/kburns
my $ssh = Net::OpenSSH->new($host, user => $USERNAME, password => $PAS +SWORD, str ict_mode => 0); $ssh->error and die "Couldn't establish SSH connection: " . $ssh->erro +r; $ssh->system('!bash') or die "remote command failed: " . $ssh->error; print "!bash done\n"; $ssh->system('pwd') or die "remote command failed: " . $ssh->error; print "pwd done\n"; # never gets here. it hangs

In reply to Re^2: Net::OpenSSH Problem by kburns1969
in thread Net::OpenSSH Problem by kburns1969

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-04-24 18:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found