Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a networked setup of 20 odd systems running ubuntu Linux where users are allowed to login using NIS+NFS. I want to change a particular user's home directory. How can I do it (from any of the connected systems)

share|improve this question

NIS client will check against its own /etc/passwd file if an user exists in order to modify it. As it does not, the client usermod operation will fail.

To modify a NIS user home directory, login as root in the NIS server and run usermod -d new_home -m username and then make -C /var/yp, where /var/yp in the NIS server configuration directory. The last command will propagate the changes to the clients. If the new_home is not accessible from the server usermod -m will fail. It is good practice to export users home dirs on NFS and I assume this is your case.

share|improve this answer
Can I do this from a machine that holds the user's home but not the NIS server? I can simply use yppasswd from the client to modify the user's password, is there some solution like this? – Nihar Sarangi Jan 4 '13 at 20:06
No, because the user is NIS user and not present in client's /etc/passwd. Also, the other clients won't know about the change. You can change the user's home from the NIS server without moving it (skip the -m option in usermod). Then the clients will see the change and this specific machine will be able to access the new home, if it is local to it or exported via NFS. – grs Jan 4 '13 at 20:58

You must log in to answer this question.

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