Issue:
Would like to rename a user.
Solution:
1. Log in as another admin user and sudo.
(You cannot login as the user whose name you are going to change.)
2. For example to change john to james, enter:
# usermod -l james -d /home/james -m john
# groupmod -n james john
3a. Check if the old home path is hard-coded anywhere:
# grep "home/john" -R .*
3b. Update files containing old path.
You can ignore .bash-history as it is going to be the commands entered above.
Command structure:
usermod -l <newname> -d /home/<newname> -m <oldname>
groupmod -n <newgroup> <oldgroup>
grep "home/<oldname>" -R .*
previous page
|