This question was moved from Categorized Questions and Answers
Please do not vote for this node. It will affect the wrong user.
Thank You -- Q&AEditors

I'm trying to write an rsh client (long story) and can't seem to get it working. Basically I'm using IO::Socket and am trying to connect to an AIX system. What I'm really looking to do is trying to specify the return port on the connection.

use IO::Socket; $new = IO::Socket::INET->new(PeerAddr=>"$aix", PeerPort=>"514", Proto= +>"tcp"); print $new "$localuser.$remoteuser.$command"; while (<$new>) { print; } close $new;
I believe the above syntax is correct because I'm actually getting back an error from the remshd. After reading the man pages on remshd I've discovered that the first check it does is on the source port of the request. It checks to make sure that the source port is 1023 or lower (makes no sense to me why). I've read through the Socket docs and the IO::Socket docs and didn't see any reference on how to specify the source port (ran sniffer and saw that all my requests were made with a source port of >2000). If anyone has any info on how to do this or if there's a module or even if this has been written already I would really appreciate any pointers.

Thanks,
Blue


In reply to Writing an rsh client (Moved from Q&A) by Russ

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.