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? Commented Jan 18, 2017 at 8:40
  • The output of a grep is a correct line with the new shell I put by hand Commented Jan 18, 2017 at 8:44
  • 4
    you should have used chsh <username>... Commented Jan 18, 2017 at 8:45
  • Consider posting the output here, and mask if there are any private stuffs present. Commented 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. Commented 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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.