I wanted to change my username, and tried out this explanation here: https://askubuntu.com/a/205470/112035.
First, I changed the username in /etc/passwd to the new one. Then I wanted to change it at /etc/group too, but since changing it at the first file I can't login as root anymore.
Is there a way to solve this? Thanks in advance!
Best Answer
You will need to get root privileges at boot time. Then you can revert the change you made and reset the password on the primary account.
How do I reset a lost administrative password?
Be very careful changing usernames. /etc/passwd associates each username with a user ID (number). In some places in the system the number is used, in others the name. To change a username without breaking things you therefore have to change the name everywhere it occurs. I would recommend that you not try to change your username unless you are an expert. If you are an expert then I don't have to tell you about usermod(8). ;-)