Changing Home directory of a NIS user
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.
Related videos on Youtube
Nihar Sarangi
Updated on September 18, 2022Comments
-
Nihar Sarangi almost 2 years
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)
-
Nihar Sarangi over 11 yearsCan 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? -
grs over 11 yearsNo, 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 inusermod
). 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.