Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.