<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi All,<div><br></div><div><div>I have a post on the forums about this. I'm hoping maybe you guys can help me track down what I'm doing wrong. </div><div><br></div><div>I am trying to get nscd to cache my LDAP user data. You know, for when the LDAP server goes down. The problem I am having is not related to the "bind_policy soft" issue that causes sshd to hand when LDAP is down. I have bind_policy set to soft and my sshd is very responsive and sends auth requests through PAM no problem. But when LDAP is down it fails to authenticate, it does not fail to ask me to authenticate. That being said I don't think my problem is a bug, I think I have configured something wrong and I'm just not seeing what. </div><div><br></div><div>My config files can be referenced on my forum post <a href="https://www.centos.org/modules/newbb/viewtopic.php?viewmode=flat&topic_id=27153&forum=42">https://www.centos.org/modules/newbb/viewtopic.php?viewmode=flat&topic_id=27153&forum=42</a></div><div><br></div><div>The problem I am having is that shadow does not seem to get cached by nscd. Here's how I have tracked this down.</div><div><br></div><div>Given the results of the following:</div><div><br></div><div><b>LDAP server UP</b></div><div><br></div><div>[root@xxxxxxxx ~]# getent passwd tester</div><div>tester:x:501:501:tester:/home/tester:/bin/bash</div><div>[root@xxxxxxxx ~]# getent shadow tester</div><div>tester:Rx5ZXH414bqiM:14802:0:99999:7:::</div><div><br></div><div><b>LDAP server DOWN</b></div><div><br></div><div>[root@xxxxxxxx ~]# getent passwd tester</div><div>tester:x:501:501:tester:/home/tester:/bin/bash</div><div>[root@xxxxxxxx ~]# getent shadow tester</div><div><br></div><div>So, when LDAP is down I can clearly see that nscd is caching passwd but not shadow. </div><div><br></div><div>To test this I checked getent's output in strace for both circumstances. The result, I can clearly see in all 4 instances a connection to nscd's socket at /var/run/nscd/socket. Since I'm assuming getent exits on first match here's my conclusion on the behavior I see.</div><div><br></div><div>When getent is looking at passwd I see it look in /etc/passwd, then nscd and then exits because nscd returns a match on passwd. It doesn't matter if LDAP is up or down. As long as nscd's cache is not expired it looks there first and never calls out to the LDAP server.</div><div><br></div><div>When getent is looking at shadow I see it look in /etc/shadow, then nscd, then tries to connect to the LDAP server. It doesn't matter if the LDAP server is up or down, getent never get's a match from nscd. Even if I turn on the LDAP server, login successfully via ssh as an LDAP authed user and then run getent...still no entry for shadow in nscd.</div></div><div><br></div><div>So, to re-state in a different way. I can't find any bug that seems to be related to this, and as it's a basic LDAP/NSCD feature my only logical conclusion is that I am doing something wrong. Any help or any suggestions as to what else I can check would be greatly appreciated.</div><div><br></div><div>Thanks</div><div><br></div><div>Brian</div></body></html>