Changed username. Now I cannot log on or view my previous files

Posted by Lauren on Ask Ubuntu See other posts from Ask Ubuntu or by Lauren
Published on 2012-09-19T04:25:43Z Indexed on 2012/10/08 9:47 UTC
Read the original article Hit count: 313

Filed under:

I want to change my username and followed the instructions from How do I change my username? by creating a temp user with admin privileges. While logged in as temp, I did :

sudo usermod -l newname oldname
sudo usermod -d /home/newname -m newname

Now I cannot log in under newname and /home only lists newname and temp

Reading through other sites now, it seems I should have used

usermod -d /home/newname -m oldname 

Based on this, I think I may have deleted the contents of my previous home folder??

I'm sure I'm not the first person to do some stupid while changing username, but any help is greatly appreciated. Thank you!

© Ask Ubuntu or respective owner

Related posts about username