The fastest way to change your Ubuntu username
The simplest method is to use the usermod command in the terminal, which renames your login name without touching your home directory or files. Open a terminal, type sudo usermod -l newusername oldusername, enter your password, and the change takes effect when ready — you log in with the new name next time.
This works because Ubuntu stores your username separately from your home folder. When you rename the account, everything inside /home/oldusername stays exactly where it is. Your files, settings, and installed programs all remain accessible under the new login name.
The one limitation: you cannot rename the account you are currently logged into. If you are the only user on the machine, you will need to either create a temporary admin account first, or boot into recovery mode. For most people with a second admin account available, the usermod route is done in under a minute.
Key Takeaways
- Use sudo usermod -l newusername oldusername in the terminal to rename any account except the one you are currently using.
- Your home folder and all files stay in place — only the login name changes.
- If you are the only user, create a second temporary admin account first, then rename your original account from that temporary one.
- After renaming, you may need to update the home folder name separately if you want the path to match, though this is optional.
- Log out completely and back in to confirm the new username is working.
Renaming your account from another admin user
If you have a second admin account on the machine, this is the easiest path. Log out of your main account and log into the admin account instead. Open a terminal and type sudo usermod -l newusername oldusername, replacing both names with your actual old and new usernames. Enter the admin account's password when prompted.
The command completes silently — no message means it worked. Log out, then log back into your main account using the new username. Your password stays the same. All your files, desktop settings, and installed programs are exactly where you left them.
Creating a temporary admin account if you are the only user
If you are the only person on the machine, you need to create a second account before you can rename your own. Open Settings, go to Users, and click the lock icon in the top right to unlock the panel (you will need your password). Click the plus sign to add a user, give it any name, and make sure you set it as an Administrator.
Once the temporary account is created, log out and log into it. Open a terminal and run sudo usermod -l newusername oldusername with your actual names. When that finishes, log out and back into your renamed main account. You can then delete the temporary account by going back to Settings > Users, selecting it, and clicking the minus button.
Renaming your home folder to match (optional)
After you rename your username, your home folder still has the old name — it will be /home/oldusername even though you log in as newusername. This does not break anything, but some people prefer them to match. To rename the folder, you need to be logged into a different account.
From another admin account, open the file manager and navigate to /home. Right-click the folder with your old username and select Rename. Type the new name and press Enter. The next time you log in, the path will be /home/newusername. If you have any scripts or configuration files that reference the old path, you will need to update those manually.
Using recovery mode if you have no second account
If creating a temporary account is not an option, you can boot into recovery mode. Restart your computer and hold Shift while it boots — you will see a menu. Select "Advanced options for Ubuntu" and then "Recovery mode". Choose "Drop to root shell prompt" and wait for the command line to appear.
At the prompt, type mount -o remount,rw / to make the system writable. Then run usermod -l newusername oldusername without the sudo prefix (you are already root). Type exit and select "Resume" to boot back into your system normally. Log in with your new username.
Recovery mode is more technical and easier to make mistakes in, so it is worth creating a temporary account first if you can. But if you are comfortable at the command line, it works reliably.
What changes and what stays the same
Your login name changes, but almost everything else stays put. Your password does not change — you use the same one with the new username. Your home directory keeps all your files, desktop background, browser bookmarks, and process settings. Installed programs continue to work. Your user ID number (UID) stays the same, so file permissions and ownership do not shift.
The only things that might need updating are scripts or configuration files that hardcode your old username in a path. For example, if you have a cron job that references /home/oldusername/backup.sh, that path will break and you will need to edit it. Most people never hit this — it only matters if you have written custom scripts or set up automation that depends on the old path.
Troubleshooting a failed rename
If you get an error saying the user is logged in, you are trying to rename the account you are currently using. Log out completely, log into a different account, and try again. If you get "user does not exist", check that you spelled the old username correctly — type whoami in a terminal to see your current username.
If the rename appears to work but you cannot log in with the new name, restart the computer and try again. Sometimes the system needs a reboot to fully register the change. If you are still stuck, you can undo the change by running sudo usermod -l oldusername newusername from another account, then troubleshoot what went wrong.
Frequently Asked Questions
Will changing my username affect my installed programs?
No. Your programs stay installed and work normally. They do not depend on your username — they depend on your user ID, which does not change. You may see your old username in some program settings or file paths, but the programs themselves will run.
Can I change my username without using the terminal?
Ubuntu's graphical Settings app does not have a built-in username changer. You can change your display name (the name that shows on the login screen), but that is different from your actual login username. The terminal command is the standard method and takes less than a minute.
What if I want to change my password at the same time?
Change your username first, then change your password. After you rename the account and log back in, open a terminal and type passwd. Enter your current password, then type your new password twice. The password change takes effect when ready.
Do I need to update my home folder name if I rename my account?
No, it is optional. Your home folder can stay named after your old username and everything will work fine. Renaming the folder is purely cosmetic — do it only if you want the path /home/newusername to match your login name.
What happens to my sudo permissions when I change my username?
Your sudo permissions stay attached to your user ID, not your username. If you were an admin before the rename, you remain an admin after. You can still use sudo commands with your new username.