The fastest way to rename your account
The simplest method is to use the usermod command, which changes your username without touching your home directory or files. Open a terminal, become the root user (or use sudo), and run usermod -l newusername oldusername. Replace "newusername" with what you want and "oldusername" with your current name. This takes seconds and keeps all your files exactly where they are.
You cannot change the username you are currently logged in as — you must switch to a different user first, or use the root account. If you are the only user on the system, restart in single-user mode or use a live USB to make the change. Most people find it easier to log in as root, make the change, then log back in with the new name.
After you run the command, log out completely and log back in with your new username. Your password stays the same. All your files, folders, and settings remain untouched because usermod only changes the name in the system's user database, not the actual directory structure.
Key Takeaways
- Use usermod -l newusername oldusername to change your username in one command without moving any files.
- You must be logged in as root or use sudo to run usermod, and you cannot change the username of the account you are currently using.
- Your home directory keeps its old name after usermod runs, which is usually fine but can be renamed separately if needed.
- Log out completely and log back in with your new username to confirm the change took effect.
When you also need to rename your home directory
The usermod command changes your username in the system database but leaves your home folder with its old name. For most people this does not matter — you can have a username "alice" with a home directory still called "/home/bob". But if you want them to match, you need an extra step.
First, change the username with usermod as described above. Then, while logged in as root, rename the directory itself: mv /home/oldusername /home/newusername. After that, update the system to point your account to the new location: usermod -d /home/newusername newusername. This tells the system where your home directory actually is.
Do this work as root or with sudo, and do it while you are logged out of the account being changed. If you try to rename a directory while you are inside it or while files in it are open, the system will refuse or cause problems.
Using the GUI if your system has one
If you are running a desktop Linux environment like GNOME or KDE, you may have a graphical settings tool. Open Settings or System Settings, look for "Users" or "Accounts", and find your user in the list. Some systems let you click your name and type a new one directly. Others require you to unlock the settings first by entering your password.
The GUI approach does the same work as usermod behind the scenes, but it handles the details for you. If the option is grayed out or missing, your system does not support changing usernames through the GUI, and you will need to use the command line instead.
The advantage of the GUI is that it usually renames your home directory at the same time, so you do not have to run multiple commands. The disadvantage is that you have less control and less visibility into what is actually happening.
What happens to your files and permissions
When you change your username with usermod alone, your files stay in place and keep working because Linux tracks ownership by a numeric user ID (UID), not by the username itself. The username is just a label for that number. So even though your name changed, your UID did not, and the system still knows those files belong to you.
If you also rename your home directory, the files inside it move to a new location but keep the same ownership. You do not have to change any file permissions or ownership manually — the move preserves everything.
The one exception is if you have files outside your home directory that you own. Those files will still belong to your UID, and the system will display your new username next to them. This is almost never a problem in a home or small office setup.
Changing the username for a different user
If you need to change someone else's username, log in as root or use sudo with the same usermod command: sudo usermod -l newusername oldusername. The person whose account you are changing does not need to be logged in, and they do not need to know their password.
Tell them their new username before they try to log in next time. Their password does not change, so they can use the same one they always have. If they have any open sessions or running programs, those will keep working until they log out — the change takes effect on the next login.
If you are managing multiple users on a shared system, write down the old and new usernames somewhere safe. It is straightforward to forget which name belonged to which person after a few weeks.
Troubleshooting if the change did not work
If you run usermod and get a message like "user is currently used by process", someone is still logged in as that user or has files open. Log them out completely, close all their programs, and try again. On some systems you may need to restart to clear all sessions.
If you get "permission denied", you are not running the command as root. Try again with sudo at the start: sudo usermod -l newusername oldusername. If sudo is not set up on your system, you will need to log in as root directly or boot into single-user mode.
If you changed the username but cannot log in with the new name, check that you typed it correctly and that you logged out and back in. Some systems cache login information and may take a moment to refresh. If you are still stuck, log in as root and run id newusername to confirm the account exists and has a valid UID.
Frequently Asked Questions
Will changing my username break my programs or settings?
No. Programs and settings are tied to your user ID, not your username. Your email client, browser bookmarks, process preferences — all of it stays exactly as it was. The only thing that changes is the label the system uses to refer to you.
Can I change my username without using the command line?
If your desktop environment has a Settings or Users tool, you may be able to change it there. Open Settings, find Users or Accounts, and look for an option to edit your account name. Not all Linux systems include this feature, so the command line is the most reliable method across all versions.
What if I forget my old username after changing it?
Log in with your new username and password — they work the same way. If you need to know what your old username was, log in as root and run id to see your current username and user ID. Your UID never changes, so that is the permanent identifier for your account.
Do I need to change my password when I change my username?
No. Your password is separate from your username and stays exactly the same. You log in with your new username and your old password. If you want to change your password at the same time, run passwd after you log in with your new name.
Can I change my username back to the old one?
Yes, use the same usermod command with the names reversed: usermod -l oldusername newusername. If you also renamed your home directory, you will need to rename it back as well. There is no limit to how many times you can change your username.