[nSLUG] Error with rsh after several error-free exchanges

Mike Spencer mspencer at tallships.ca
Sat Oct 18 04:20:03 ADT 2014

I have a script that tries to do rsh several hundred times between two
local hosts.

It runs as expected for a few instances, then begins to report:

    poll: protocol failure in circuit setup

repeatedly and and fails to return any further data to the client host.

Google turns up cases where rsh failed completely, was enabled by
closing down the firewall.  Mine works fine a few times, THEN fails.
A subsequent rsh command executed from the keyboard works.  In any
case, iptables at both hosts has:

   Chain INPUT (policy DROP)
   ACCEPT     all  --  localnet/27   anywhere

   Chain OUTPUT (policy DROP)
   ACCEPT     all  --  anywhere      anywhere    state NEW,RELATED,ESTABLISHED

The manpage for inetd(8) says, about the "shell...in.rshd" line in

     The optional ``max'' suffix (separated from ``wait'' or ``nowait''
     by a dot) specifies the maximum number of server instances that
     may be spawned from inetd within an interval of 60 seconds.  The
     default is unlimited

/usr/bin/rsh is -rws--x--x.

This is between 2 machines on my LAN, not over the public internet so
security isn't a problem.

My guess is: something about the source ports chosen for the replies but
I don't have a clue how to control that.  I haven't packet-sniffed the
exchange to verify that guess.

Suggestions? Is this a well-known thing that cluless folks such as I
fall over?

- Mike

Michael Spencer                  Nova Scotia, Canada       .~. 
mspencer at tallships.ca                                     /( )\
http://home.tallships.ca/mspencer/                        ^^-^^

More information about the nSLUG mailing list