Change administrator username

Posted by Fazlan on Ask Ubuntu See other posts from Ask Ubuntu or by Fazlan
Published on 2012-12-13T16:56:25Z Indexed on 2012/12/13 17:16 UTC
Read the original article Hit count: 218

I have accidentally typed my name wrong when I created the administrator account. Although I managed to change the user name at the login screen, I am unable to rename the /home/oldusername to /home/newusername. I tried most of the online tutorials, and it failed.

The code I tried was this:

usermod -l newusername -m -d /home/newusername oldusername

But the output is:

cannot lock /etc/passwd; try again later.

How can I fix the issue and change the folder to newusername and expect all the applications to work as before?

© Ask Ubuntu or respective owner

Related posts about user-accounts

Related posts about rename