Cached account info

Hello,
A admin at work created accounts for me on about 20 SLES 11 servers. He gave me the wrong home directory. He also didn't create a home directory for me on the servers. I have root/sudo on the systems. I usually use the usermod command or just modify the /etc/passwd file to fix issues like this on Solaris or Red Hat servers. Theis not working very well on the SLES servers. It seams that my account is somehow cashed and the changes do not take affect right away. Is there a way I can force the changes to take affect sooner?

What makes you think the accounts are cached (this really isn't a valid concept)? Make sure of the type of authentication...it could be directory based (like ldap).

All the accounts are local accounts. There is no directory server. All I know is the account changes take a while to take affect.

Solaris and SuSE ship with nscd. That caches login shell and home directory according to /etc/nscd.conf (the passwd lines).

I looked at the /etc/nscd.conf file on both Soalris and Susie servers. The Susie servers have enable-cache set to yes on passwd, goup and services. The Solaris server has one line for the hosts which is commented out.

I will look into this some more, maybe I can find a way to edit this file so I don't have this issue any more.

With the following it should clear the passwd cache if /etc/passwd is changed

reload-count  0
check-files  passwd  yes

I just restart nscd if I can't wait. BTW recent redhat uses sssd instead.

Thanks guys will give those a try.

I tried to do a restart of the nscd service and it didn't help.

Then maybe you have a shell that behaves like ksh. Here is a test...

$ exec ksh
$ echo ~testgut
/home/testgut
$ getent passwd testgut
testgut:x:13128:13128::/home/testgut:/bin/bash
$ sudo ksh
# vi /etc/passwd
# getent passwd testgut
testgut:x:13128:13128::/data/home/testgut:/bin/bash
#
$ echo ~testgut
/home/testgut

The problem is that ksh has cached the meaning of ~testgut. I don't know a gentle way to make it refresh. So I do this...

$ exec ksh
$ echo ~testgut
/data/home/testgut
$

The "exec ksh" gives me a freshly started copy of ksh.

Also, any program can do what ksh did. You may be using some other program that has a private cache. There may be some way built in to handle a refresh. Or maybe you need to restart it entirely as I did with ksh.

I use bash as my shell. Bash is similar to ksh.

Please also ensure you have

persistent  passwd  no

in /etc/nscd.conf!