[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: how to rsh/rlogin as root with PAM ?



Harald Koenig wrote, on the axp-list:
>- without having a ~root/.rhosts file  rsh/rlogin succeeds for root
>when I have a /etc/hosts.equiv entry for the source host which should
>not be (for all other systems I know /etc/hosts.equiv doesn't work for root).

Here's a patch to the 0.50 pam_rhosts_auth.c which seems to solve the
problem...

--- Linux-PAM-0.50/modules/pam_rhosts/pam_rhosts_auth.c.equiv	Tue Sep 10 10:41:00 1996
+++ Linux-PAM-0.50/modules/pam_rhosts/pam_rhosts_auth.c	Tue Sep 10 10:45:35 1996
@@ -250,7 +250,7 @@
     int answer;
     char pbuf[MAXPATHLEN];
 
-    if (superuser || ! opts->opt_no_hosts_equiv) {
+    if (!superuser || ! opts->opt_no_hosts_equiv) {
 	hostf = fopen (_PATH_HEQUIV, "r");
 	if (hostf) {
 	    answer = __ivaliduser(opts, hostf, raddr, luser, ruser);
@@ -260,7 +260,7 @@
 	}
     }
     
-    if (opts->opt_no_rhosts || superuser)
+    if (opts->opt_no_rhosts)
 	return (1);
 
     pwd = getpwnam(luser);
@@ -420,7 +420,7 @@
 /*
  * Validate the account information.
  */
-	if (pam_ruserok (&opts, rhost, 0, ruser, luser) != 0)
+	if (pam_ruserok (&opts, rhost, !strcmp("root", luser), ruser, luser) != 0)
 	    retval = PAM_AUTH_ERR;
       } while (0);
 


michaelkjohnson

"Ever wonder why the SAME PEOPLE make up ALL the conspiracy theories?"




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []