In Linux, there is no command which will rename a user account. If you make a mistake creating a user account, user changes their name or if user does not like his user name, there is no real easy way of going and making the change. Only thing I know you can do is to go through some files and rename user manually. Let us say that we have a user who is named joe and we want to rename him to john.
Note: you must be logged in as root to do following.
vi /etc/passwd
find joe and change it to john, save/exit
vi /etc/group
find joe and change it to john, save/exit
vi /etc/shadow
find joe and change it to john. This file is read only and you
have to force overwrite it. In vi it is :w! once saved, quit.
cd /home
mv joe john
And that should do the trick.
[Edited] Right after I posted this post, I was contacted and was told to look at utility called usermod. Read …
[Read more]