Amazon holiday deals See deals →ad

Mets Minor League Blog

Music theory, instruments and musicians

Mets Minor League Blog

Music theory, instruments and musicians

Linux Mint: How to Change Your Username Safely

Yes, you can change a username in Linux Mint, but it is safest to do it from a different administrator account while the account being renamed is logged out. Changing the login name is separate from changing the account’s home-folder path, so decide whether you want to change both before you begin.

What a username change affects

A Linux username is the account’s login name and is associated with a numeric user ID (UID), a primary group, a home directory, and permissions on files. Renaming an account normally changes its name, not its UID. Keeping the UID means the account remains the owner of its existing files, even when its login name changes.

The home directory is commonly named after the user, such as /home/alex, but it is a separate setting. If you rename alex to sam, the account might still use /home/alex. That can work, but it may be confusing. Renaming the home directory as well is a separate operation, and applications or scripts may contain the old path.

This is not the same as changing the computer’s hostname, the name shown on the login screen, or the password. Each is configured separately. Before making changes, confirm whether you mean the account login name, the home-folder name, or both.

Before you rename the account

Do not rename an account while logged into that same account. The desktop session and running processes continue to use the account’s identity and files; changing its name underneath them can cause confusing errors or leave settings in an inconsistent state. Instead, use another administrator account, or create one temporarily if necessary.

  • Back up important files. A username change should not erase data, but a backup gives you a recovery option if a command is mistyped or a path is moved incorrectly.
  • Check administrator access. The account performing the change needs permission to administer users, usually through the sudo group or an equivalent administrator role.
  • Sign out completely. Log out of the account to be renamed. Do not merely lock the screen or switch users while leaving its session active.
  • Write down the current details. You can check the account and home path with id oldname and getent passwd oldname, replacing oldname with the actual login name.
  • Choose a valid, unused name. Linux usernames are conventionally lowercase and should not contain spaces. Check that the new name is not already assigned to another account.

If this is the only administrator account, create a second administrator before proceeding and test that you can log into it. Avoid deleting the original account as a shortcut: doing so can remove or orphan its files and settings.

Change it with Linux Mint’s user settings

Linux Mint editions and releases can present user-management tools differently. Open the menu and search for Users and Groups or Users. If the tool is installed and offers an account-name field, unlock it with administrator authentication, select the target account, and use its edit option. Do not assume every Mint installation includes a graphical control for changing an existing login name; some tools allow password or account-type changes but not renaming.

If the displayed tool only changes the full name, that changes the descriptive name shown in places such as the login screen, not necessarily the account’s login name. Check the resulting account details rather than treating those two names as interchangeable. If no clear username-edit option is available, use a terminal from the second administrator account or consult the command-line method below.

Rename the login name from another account

Linux Mint uses standard Linux account-management utilities. From a separate administrator account, open Terminal and replace oldname and newname with the real names. The following commands rename the login and move the home directory to match:

  1. Rename the account: sudo usermod -l newname oldname
  2. Move and update its home directory: sudo usermod -d /home/newname -m newname

Run the first command only if you want to change the login name. The second command is optional if you want to keep the existing home path; if you run it, make sure the destination path is appropriate and not already occupied. The -m option tells usermod to move the contents of the old home directory to the new one. Do not add it casually when the target directory already exists or contains files you need.

If the account has a private group with the same name, consider whether that group should also be renamed. On many systems, the user’s primary group has the same name, but this is not guaranteed. Check with id newname. If the old group exists and you intend to rename it, use sudo groupmod -n newname oldname only after confirming that it is the account’s group and the new group name is free. Do not change the UID simply to rename the user.

Afterward, verify the account with getent passwd newname and id newname. Restart the computer or sign out of the administrator account and try logging in as the renamed user. Keep the second administrator account until you have confirmed the new login and files work.

What can go wrong, and how to avoid it

The most common confusion is that changing the login name does not automatically make every occurrence of the old name disappear. Files outside the home directory may still be owned by the user’s UID, which is usually fine, but scripts, scheduled jobs, application settings, mount rules, and backups can refer to an old username or path. Review any custom configuration that uses /home/oldname.

  • “User is currently used by process.” The account may still have a desktop session, terminal, or background process running. Log out fully and check again from the other administrator account.
  • The old home path remains. That is expected if you changed only the login name. Update the home directory separately only if you want to move or rename it.
  • Login fails after moving the home folder. Check the home-directory field in getent passwd newname and verify that the directory exists and is accessible to the user.
  • Some files appear to have the wrong owner. Do not recursively change ownership across the whole system. First inspect the affected path and UID; broad ownership commands can damage system files.

Renaming an account is generally manageable, but it is not a cosmetic change if other software depends on the old path. For a new installation with little data, creating a correctly named account and migrating personal files may be simpler. Preserve permissions carefully and do not remove the old account until the new one has been tested.

Frequently Asked Questions

Can I change my Linux Mint username without losing files?
Yes. Renaming the account does not inherently delete its files. Use a second administrator account, keep the UID unchanged, and back up important data first. Moving the home directory is optional and should be done deliberately.

Does changing the username also rename the home folder?
No, not necessarily. The login name and home-directory path are separate account properties. If you want both changed, update the home path and move the directory as a separate step.

Can I change the username while logged in?
Do not rename the account whose desktop session is active. Log out of it and perform the change from another administrator account to avoid active processes and session files interfering.

How do I change only the name shown on the login screen?
Change the account’s full or display name in the user-management tool, if available. That is different from changing the login username used at the sign-in prompt and in commands.

Is it safer to create a new account instead?
For an account with little data or many custom settings, creating a new administrator account and copying personal files may be easier. For an established account, a careful rename can preserve its UID and file ownership, but check software that uses the old home path.

Related

After the change

Once you have successfully signed in, confirm that documents, desktop settings, and commonly used applications behave normally. Update saved paths in scripts or shortcuts where needed, and retain a working administrator account for recovery. A username change is complete when both the account details and the paths you intended to change are correct—not simply when the login screen displays a new name.

Linux Mint: How to Change Your Username Safely
Scroll to top