1

In one of the machines I work with I'm seeing a strange behaviour. I've manually changed the shell of one user in /etc/passwd but when I try to login with that user, it still uses the old one. getent also shows the old one. But a grep on the /etc/passwd file confirms I saved the file correctly.

Is there (on Linux) any kind of /etc/passwd caching?

How to avoid it?

8
  • Whats the output of grep <that_user> /etc/passwd?
    – heemayl
    Jan 18, 2017 at 8:40
  • The output of a grep is a correct line with the new shell I put by hand
    – Envite
    Jan 18, 2017 at 8:44
  • 4
    you should have used chsh <username>...
    – 13dimitar
    Jan 18, 2017 at 8:45
  • Consider posting the output here, and mask if there are any private stuffs present.
    – heemayl
    Jan 18, 2017 at 8:46
  • 4
    This information could be stored in your company LDAP/AD, in particular, if the machine is set up to authenticate against LDAP/AD anyway. Jan 18, 2017 at 9:54

1 Answer 1

1

Do you have a process named nscd running? That's the name service caching daemon.

If it is running, you may need to run sudo nscd -i passwd to tell it that it should forget any cached /etc/passwd file data. It has other caches too: the respective keywords for them are group, hosts, services and netgroup.

It is more commonly used with LDAP/AD/NIS-based authentication schemes, but may improve system performance if you're running some process that makes a very large number of user/group/service/hosts-file look-ups. Or if you have installed some services you're not actually using (perhaps to use just a small part of them), some service may have pulled nscd in as a dependency.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .