Here I am listing the steps in order to change the username and home directory of a a user in Ubuntu,
Step-1
We need to check that if the username that we are going to change has been used by any of the system processes, if any we have to kill them first,
# killall -u "Present Username"
Step-1
We need to check that if the username that we are going to change has been used by any of the system processes, if any we have to kill them first,
# killall -u "Present Username"
Step-2
Once we flushed all the running services behalf of the User, we need to execute the below command in order to take effect the changes,
# usermod
-l "New Username" "Present Username"
Note: You will get a list of useful functions about usermod by typing $man usermod command
Step - 3
This time we are going to change the group name associated with the user,
#groupmod
-n "New Username" "Present Username"
Step - 4
In order to complete these settings we need to change the name of the user home directory,
# usermod
-d /home/new -m new where the "new" will be our New Username
Step -5
The below command is used to change the GUI username while we select a particular one,
#usermod
-c “New Real Name” new
Comments
Post a Comment