<p>I'm trying to use <strong>NIS</strong> for authentication on a st of machines. I had to change one of the user ID numbers for a user account on the NIS server (I changed the userid for <code>username</code> from 500 to 509 to avoid a conflict with a local user account with id 500 on the clients). The problem is that it has not updated properly on the client. </p>

<p>In particular, if I do <code>ypcat passwd | grep username</code>, I get the up-to-date info:</p>

<pre><code>username:*hidden*:509:509:User Name:/home/username:/bin/bash
</code></pre>

<p>But if I do, <code>ypmatch username passwd</code>, it says:</p>

<pre><code>username:*hidden*:500:500:User Name:/home/username:/bin/bash
</code></pre>

<p>This means that when the user logs onto one of the clients, it has the wrong userid, which causes all sorts of problems. I've done <code>"cd /var/yp; make"</code> on the server, and <code>"service ypbind restart"</code> on the client, but that hasn't fixed the problem. Does anybody know what would be causing this and how I can somehow force a refresh on the client? (I'm running Fedora 8 on both client and server).</p>

[{'answer_id': 32770, 'author': 'Lorin Hochstein', 'author_id': 742, 'author_profile': 'https://Stackoverflow.com/users/742', 'pm_score': 1, 'selected': False, 'text': '<p>OK, I found the problem, I also had to restart the NIS service on the server to get it to refresh everything (<code>"service ypserv restart"</code>)</p>\n'}, {'answer_id': 33434, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': "<p>hmm, you're not supposed to have to restart the ypserver to have updates take effect;  the <em>make</em> in /var/yp ought to do the trick.  you might want to check the Makefile in /var/yp to be sure it's triggering on the right conditions (namely, passwd.by* should check the timestamp on /etc/passwd in some fashion, versus its current table.  the process used to go through a passwd.time rule on the NIS server i ran, back in the dark ages).  killing and restarting your nis server can have funky effects on (particularly non-linux) clients, so be careful doing it willy-nilly.</p>\n"}, {'answer_id': 3687735, 'author': 'John O', 'author_id': 444677, 'author_profile': 'https://Stackoverflow.com/users/444677', 'pm_score': 2, 'selected': False, 'text': '<p>Encountered same problem - RHEL 5.5.  Change (any) source map, then run make.  ypcat shows the changed info, ypmatch does not.  Anything that needs to actually --use-- the new map fails.  As per last post, restarting ypserv makes all OK.  After days of testing, running strace, etc. I found that ypserv has a "file handle cache" controlled by the "file:" entry in /etc/ypserv.conf --- the default value is 30.  Change this to 0 and everything works following the make.  </p>\n\n<p>Shouldn\'t have to do this --- Per the manpage for ypserv.conf... </p>\n\n<p>"There was one big change between ypserv 1.1 and ypserv 1.2. Since version 1.2, the file handles are cached. This means you have to call makedbm always with the -c option if you create new maps. Make sure, you are using the new /var/yp/Makefile from ypserv 1.2 or later, or add the -c flag to makedbm in the Makefile. If you don\'t do that, ypserv will continue to use the old maps, and not the updated one."</p>\n\n<p>The makefile <strong>DOES</strong> use "makedbm -c", but still ypserv uses the old (cached) map.</p>\n\n<p>Answer:  Don\'t cache the file handles, e.g. set "files: 0" in ypserv.conf</p>\n'}, {'answer_id': 12900738, 'author': 'Bradley Kreider', 'author_id': 268907, 'author_profile': 'https://Stackoverflow.com/users/268907', 'pm_score': 3, 'selected': False, 'text': '<p>John O pointed me in the right direction.  </p>\n\n<p>He is right.  If you set "files: 0" in /etc/ypserv.conf, you can get ypserv to not cache files.  If you have to restart ypserv after each make, this is the problem.</p>\n\n<p>The real solution is to look in /var/log/messages for this error:  </p>\n\n<pre><code>ypserv[]: refused connect from 127.0.0.1 to procedure ypproc_clear (,;0)\n</code></pre>\n\n<p>makedbm -c means:  send YPPROC_CLEAR to the local ypserv.  The error message in the log means that CLEAR message is getting denied.  You need to add 127.0.0.1 to /var/yp/securenets.  </p>\n'}, {'answer_id': 41453662, 'author': 'Parthasarathi Sahu', 'author_id': 7371642, 'author_profile': 'https://Stackoverflow.com/users/7371642', 'pm_score': 0, 'selected': False, 'text': '<p>it is because of the nscd daemon.\nset the time to live value to 60 in /etc/nscd.conf for passwd session. It will work</p>\n'}]
['https://Stackoverflow.com/questions/32694', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/742/']