rsh fails
Setup
I was on a FreeBSD 2.2.8 machine, foxy, attempting to rsh as root to a FreeBSD 5.1 machine, chewie. chewie:/root/.rhosts contains foxy root.
Symptoms
When I specified a command, rsh fails. If I did not specify the command, I was logged in to chewie as root without being prompted for a password.
foxy # rsh chewie hostname
rshd: Login incorrect.
foxy # rsh chewie
Welcome to chewie!
chewie #
Background
The ~/.rhosts file specifies a list of remote host/remote user pairs which are trusted; rsh does not prompt such remote host/user pairs for a password. rshd calls rlogind if there is no command specified. Otherwise, it handles the authentication.
Resolution
The pam_rhosts(1) manpage details an allow_root option. Simply add allow_root to the end of the relevant line in /etc/pam.d/rsh.
-auth required pam_rhosts.so no_warn
+auth required pam_rhosts.so no_warn allow_root