I tried to use pam_env to set the REMOTEHOST (PAM_RHOST) and REMOTEUSER (PAM_RUSER) variables - one of the best things of Irix ... ;) However: REMOTEHOST doesn't work for rsh (but for rlogin), REMOTEUSER never works. I had a look at the netkit-rsh source and found that this wasn't set there ... My patch automatically sets the REMOTEUSER and a REMOTEHOST variables. (I maybe should have a look at rexec, too - don't know that protocol, don't know if the user is given as parameter when connecting).
Created attachment 19972 [details] REMOTEHOST and REMOTEUSER patch for rshd and rlogind
It was just the other way round ... REMOTEHOST worked for rlogin, not for rsh.
*** Bug 16170 has been marked as a duplicate of this bug. ***
Included in 0.17-6, available via rawhide real soon now... Read ya, Phil