Yes, you can change a Linux Mint account’s login username, but it is safest to do it while signed in to a different administrator account—not from the account you are renaming. The change is usually made with terminal commands; the account’s display name and its home-folder path are separate details that may need updating too.
What a Linux Mint username change affects
Your username is the account name used to sign in and identify you to Linux. It is not necessarily the name shown on the login screen or in menus: Linux keeps a separate full name, sometimes called the real name or display name. Changing that full name does not rename the login account or its home folder.
A typical account might sign in as alex, have the full name “Alex Morgan,” and store files in /home/alex. Renaming the login to amorgan does not automatically mean that every related setting changes. In particular, the home-directory path is a separate account property. Many people want to change both the login name and the folder to /home/amorgan, but you can also keep the existing folder path if you prefer.
The account’s numeric user ID (UID) is also distinct from its username. A normal username change does not require changing the UID, and keeping it unchanged helps preserve the account’s ownership of existing files. This is why renaming an account is not the same as creating a new account with a different name.
Before changing the account
Prepare before editing an account. A mistake can make a login inconvenient or leave you without an administrator account, even though it usually does not erase files. Take a current backup, and make sure you know how to sign in to another administrator account.
- Choose a simple new login name, such as
alexm. Linux account names are generally written in lowercase and without spaces; avoid punctuation unless you know the software you use supports it. - Check that the new name is not already in use. In a terminal,
getent passwd newnameprints an account entry if that name exists. Replacenewnamewith your proposed name. - Back up important personal files and, if practical, make a Timeshift snapshot. A snapshot is useful for system recovery, but it should not replace a separate backup of irreplaceable documents.
- Check whether your home directory is encrypted or mounted from a separate disk. Encryption tools and custom mount settings can rely on the old name or path, so a basic rename may not be enough.
- Make sure you have a second administrator account, and test that you can sign in to it before proceeding.
The safest way to prepare another administrator
Do not rename the account while you are logged into it. Desktop applications, background services, and the desktop session may still be using the old account name or its files. Instead, create a temporary or permanent second administrator and perform the rename from that account.
In Linux Mint, open the application menu and search for Users and Groups. The precise appearance can vary by Mint release, but the user-management tool lets an administrator add an account and set its account type. Create a separate user, set it as an administrator if the option is available, and choose a password. Sign out of the account you intend to rename, then sign in to the second administrator. If the tool is absent or its controls differ in your release, use the terminal method only after confirming that another administrator account works.
Keep the second administrator until you have successfully signed in to the renamed account and checked your files. If it was created only for this task, you can remove it afterward through the user-management tool. Do not delete your only working administrator account as part of the process.
Rename the login and home folder from the terminal
Open Terminal while signed in to the second administrator. The examples below use oldname for the existing login and newname for the chosen login. Substitute your actual names exactly; do not type the angle-bracket placeholders sometimes used in instructions.
- Change the login name:
sudo usermod -l newname oldname. Enter the administrator password when prompted. This changes the account’s login name but does not by itself rename its home directory. - If the account’s home folder is the usual
/home/oldnameand you also want it renamed, run:sudo usermod -d /home/newname -m newname. The-doption sets the home-directory path, and-mtells the command to move the existing home contents there. - Check the account’s group information with
id newname. Some installations have a primary group named after the user. If it is namedoldname, and that group is used only as this account’s personal group, you may rename it withsudo groupmod -n newname oldname.
The group step is optional. Do not rename a group blindly: it may be shared with other accounts, or the account may use a differently named group. Review the output of id newname and the group entry first. If the old group has other members or you are uncertain about its purpose, leave it alone or get help from an administrator familiar with the system.
If your home directory is not /home/oldname, use its actual current path in the home-directory command. For example, a home on a separate data disk may be mounted elsewhere. Do not run the example command unchanged if its source or destination does not match your setup.
Verify the result before removing the backup account
After the commands complete without errors, sign out of the second administrator and try signing in with the new username and the account’s existing password. On the login screen, you may need to select the user manually or type the new name, particularly if automatic login is enabled. Once the desktop opens, check that your documents, desktop files, and commonly used applications are present.
You can also open a terminal in the renamed account and run whoami to confirm the login name, echo "$HOME" to see the home path, and id to inspect the user ID and groups. Confirm that the home path is the one you intended. Test a few files and applications before removing the second administrator or deleting any backup.
Automatic login may still have the old username saved in the login settings. Update it if the system continues trying to sign in as the previous name. Applications that store a full path such as /home/oldname/Documents in their own settings may also need adjustment. These are references to a path, not proof that the account rename failed.
Can you do it in the graphical settings?
Linux Mint’s graphical user-management tools are useful for adding accounts, changing passwords, and selecting account types. The available controls vary with the Mint edition and release, and a field for a person’s full name is not necessarily a control for the login name. If a screen lets you edit “Name,” check whether it changes the sign-in username or only the display name before relying on it.
For an existing account, the terminal method makes the distinction explicit: usermod -l changes the login, while usermod -d changes the recorded home path and -m moves the directory contents. If you would rather avoid account-editing commands, creating a new administrator account and copying your personal files is a reasonable alternative, described below. Do not assume that simply renaming a folder in the file manager updates the account’s configured home path.
Common problems and important cautions
- The account is still in use: The rename can fail if the old user has an active desktop session or running processes. Sign out of that user completely and use the separate administrator account. Closing a terminal window while still logged in as the target user is not the same as ending the desktop session.
- The new name is taken: Pick another name if
getent passwd newnamereturns an account entry. Do not rename or remove an unrelated account just to free the name. - The login changes but the folder does not: This is expected if you ran only
usermod -l. Decide whether to keep the old home path or update it separately with the home-directory command. - Permissions appear wrong: A normal rename keeps the UID, so the account should retain ownership of its files. Avoid running a broad command such as
chown -Racross the whole system to “fix” a rename; it can damage ownership for system files and other users. Investigate the specific file or path instead. - Encrypted or custom home setup: An encrypted home, network home, or separately mounted directory can involve additional configuration. Do not assume moving it with
-mpreserves every encryption or mount setting. Back up first and follow the instructions for that specific setup.
A username change does not change your password, UID, or the contents of your files by itself. It can, however, affect scripts, scheduled jobs, application settings, or services that explicitly refer to the old username or old home path. If you use the account for server services or automated tasks, review those references after testing the desktop login.
When creating a new account is a better alternative
If you only want a different name shown on the login screen or in menus, change the account’s full name rather than its login. That avoids changing paths and references. If you genuinely need a different login but are uncomfortable editing the existing account, create a new user with the desired name, give it administrator rights if needed, and copy personal files from the old account.
Copying files is not identical to renaming: application preferences, browser profiles, hidden configuration folders, mail data, and file ownership may need attention. Do not copy every hidden file automatically if you are trying to solve a problem caused by damaged settings; doing so can reproduce the problem in the new account. Keep the old account until you have verified the new one and backed up any data you need. This approach takes longer but can be easier to reverse because the original account remains intact during testing.
Related
Frequently Asked Questions
Can I change my Linux Mint username without losing files?
Usually, yes. Renaming the login does not delete the account’s data, and retaining the UID preserves normal file ownership. Back up important files first, use a separate administrator account, and verify the home folder before removing any other account.
Does changing the username also rename the home folder?
No. The login name and home-directory path are separate. Use the home-directory option to move a standard home folder, or keep the existing path if that better suits your setup.
Can I rename the account while logged in to it?
Do not do so. The active desktop session and background processes can depend on the account being changed. Sign in to a different administrator account, or create one before starting.
Will my password change when I rename the user?
No. A username change does not change the password. Use the existing password at the next sign-in unless you separately choose to reset it.
Is changing the full name the same as changing the username?
No. The full name is a display label, while the username is the login and account identifier used by Linux. Changing the display label may be enough if you only want a different name shown in the interface.