Skip to main content
ubuntuask.com

Back to all posts

How to Change Your Ubuntu Username?

Published on
7 min read
How to Change Your Ubuntu Username? image

Best Tools and Guides to Change Your Ubuntu Username to Buy in November 2025

1 Beamo Ubuntu Desktop 24.04.3 LTS (Very Latest Release) 64-bit Bootable USB Flash Drive, Live USB for Installing and Repairing Ubuntu Desktop

Beamo Ubuntu Desktop 24.04.3 LTS (Very Latest Release) 64-bit Bootable USB Flash Drive, Live USB for Installing and Repairing Ubuntu Desktop

  • SEAMLESS INSTALLATION: COMPATIBLE WITH MOST MODERN PCS-NO HASSLES!

  • USER-FRIENDLY INTERFACE: IDEAL FOR BOTH BEGINNERS AND EXPERIENCED USERS.

  • FAST PERFORMANCE: HIGH-QUALITY USB ENSURES QUICK AND RELIABLE INSTALLS.

BUY & SAVE
$15.99
Beamo Ubuntu Desktop 24.04.3 LTS (Very Latest Release) 64-bit Bootable USB Flash Drive, Live USB for Installing and Repairing Ubuntu Desktop
2 Generic Ubuntu Linux 24.04 LTS (Latest Version) Bootable Live USB Flash Drive 64-bit for PC/Laptop, Black

Generic Ubuntu Linux 24.04 LTS (Latest Version) Bootable Live USB Flash Drive 64-bit for PC/Laptop, Black

  • ADVANCED THREAT PROTECTION: SAFEGUARD AGAINST MALWARE AND RANSOMWARE.
  • FASTER BOOT TIMES: GET UP AND RUNNING QUICKLY WITH IMPROVED SPEED.
  • LATEST SOFTWARE PACKAGES: ENJOY THE NEWEST VERSIONS OF ESSENTIAL APPS.
BUY & SAVE
$16.99 $17.99
Save 6%
Generic Ubuntu Linux 24.04 LTS (Latest Version) Bootable Live USB Flash Drive 64-bit for PC/Laptop, Black
3 Bootable USB Drive Installer for Windows 11,10, 8, 7, Linux, Ubuntu, Kali, Tails, Utility Suite w/Password Reset, Data Recovery, Boot Fix, and More. Installer

Bootable USB Drive Installer for Windows 11,10, 8, 7, Linux, Ubuntu, Kali, Tails, Utility Suite w/Password Reset, Data Recovery, Boot Fix, and More. Installer

  • ALL-IN-ONE SOLUTION: USB DRIVE FOR OS INSTALLS, REPAIRS & DATA RECOVERY!

  • NO INTERNET NEEDED: FULLY FUNCTIONAL UTILITY SUITE AVAILABLE OFFLINE.

  • EXPLORE LINUX EASILY: BOOT POPULAR DISTRIBUTIONS SECURELY FROM USB.

BUY & SAVE
$17.41 $19.71
Save 12%
Bootable USB Drive Installer for Windows 11,10, 8, 7, Linux, Ubuntu, Kali, Tails, Utility Suite w/Password Reset, Data Recovery, Boot Fix, and More. Installer
4 EZITSOL 32GB 9-in-1 Linux bootable USB for Ubuntu,Linux Mint,Mx Linux,Zorin OS,Linux Lite,ElementaryOS etc.| Try or Install Linux | Top 9 Linux for Beginners| Boot Repair | multiboot USB

EZITSOL 32GB 9-in-1 Linux bootable USB for Ubuntu,Linux Mint,Mx Linux,Zorin OS,Linux Lite,ElementaryOS etc.| Try or Install Linux | Top 9 Linux for Beginners| Boot Repair | multiboot USB

  • VERSATILE 9-IN-1 LINUX USB FOR DIVERSE USER NEEDS.
  • TRY LINUX DISTROS RISK-FREE WITHOUT ALTERING YOUR PC.
  • BEGINNER-FRIENDLY WITH ESSENTIAL PRE-INSTALLED SOFTWARE.
BUY & SAVE
$19.77
EZITSOL 32GB 9-in-1 Linux bootable USB for Ubuntu,Linux Mint,Mx Linux,Zorin OS,Linux Lite,ElementaryOS etc.| Try or Install Linux | Top 9 Linux for Beginners| Boot Repair | multiboot USB
5 Linux Ubuntu OS for Desktops and Servers - Bootable Live Install USB Flash Thumb Drive - Great for Everyday Tasks and Professional Web Development + Tin Case

Linux Ubuntu OS for Desktops and Servers - Bootable Live Install USB Flash Thumb Drive - Great for Everyday Tasks and Professional Web Development + Tin Case

  • ULTIMATE COMPATIBILITY: WORKS WITH MOST PCS-OLD AND NEW-EFFORTLESSLY!

  • NO INTERNET NEEDED: INSTALL AND RUN ANYWHERE, ANYTIME-PURE CONVENIENCE!

  • SUPPORT INCLUDED: RAPID RESPONSE SUPPORT FOR TROUBLESHOOTING-24-HOUR HELP!

BUY & SAVE
$24.99
Linux Ubuntu OS for Desktops and Servers - Bootable Live Install USB Flash Thumb Drive - Great for Everyday Tasks and Professional Web Development + Tin Case
6 Ubuntu Linux Toolbox: 1000+ Commands for Ubuntu and Debian Power Users

Ubuntu Linux Toolbox: 1000+ Commands for Ubuntu and Debian Power Users

  • AFFORDABLE PRICES ON QUALITY USED BOOKS ENHANCE SAVINGS FOR READERS.
  • WELL-MAINTAINED CONDITION ENSURES ENJOYABLE READING EXPERIENCES ALWAYS.
  • SUSTAINABLE CHOICE SUPPORTS RECYCLING AND ECO-FRIENDLY PRACTICES.
BUY & SAVE
$17.70 $29.99
Save 41%
Ubuntu Linux Toolbox: 1000+ Commands for Ubuntu and Debian Power Users
7 Pixiecube Linux Commands Line Mouse pad - Extended Large Cheat Sheet Mousepad. Shortcuts to Kali/Red Hat/Ubuntu/OpenSUSE/Arch/Debian/Unix Programmer. Non-Slip Gaming Desk mat

Pixiecube Linux Commands Line Mouse pad - Extended Large Cheat Sheet Mousepad. Shortcuts to Kali/Red Hat/Ubuntu/OpenSUSE/Arch/Debian/Unix Programmer. Non-Slip Gaming Desk mat

  • PERFECT SIZE FOR WORK & PLAY: 800X300MM, AMPLE SPACE FOR LAPTOP & MOUSE.

  • ULTIMATE LINUX REFERENCE: ORGANIZED COMMAND LINES FOR ALL SKILL LEVELS.

  • DURABLE & EASY TO CLEAN: PROTECTS SURFACES WHILE ENSURING FAST, SMOOTH USE.

BUY & SAVE
$20.95
Pixiecube Linux Commands Line Mouse pad - Extended Large Cheat Sheet Mousepad. Shortcuts to Kali/Red Hat/Ubuntu/OpenSUSE/Arch/Debian/Unix Programmer. Non-Slip Gaming Desk mat
+
ONE MORE?

To change your Ubuntu username, you need to follow these steps:

  1. Log in as a different user with administrative privileges, or switch to the root account using the sudo su command.
  2. Open a terminal by pressing Ctrl+Alt+T.
  3. Make sure you're in the root user's home directory by running cd ~.
  4. Rename the current username directory using the following command: mv /home/old_username /home/new_username, where "old_username" is your current username, and "new_username" is the desired new username.
  5. Change the ownership and group of the renamed directory using: chown -R new_username:new_username /home/new_username, where "new_username" is your new username.
  6. Edit the /etc/passwd file using a command-line text editor such as nano, and change the old username to the new username. For example: nano /etc/passwd.
  7. Similarly, edit the /etc/group file using nano or any other text editor and change the old username to the new username. For example: nano /etc/group.
  8. Rename the login name using the usermod command: sudo usermod -l new_username old_username, where "new_username" is the desired new username, and "old_username" is your current username.
  9. Update the user's home directory name using the usermod command: sudo usermod -d /home/new_username -m new_username, where "new_username" is your new username.
  10. Change the group name using the groupmod command: sudo groupmod -n new_username old_username, where "new_username" is your new username, and "old_username" is your current username.
  11. Finally, restart your system to apply the changes by using the reboot command.

Ensure you have a proper backup and proceed with caution while changing the username to avoid any issues with system files or user data.

Can I revert back to the previous username if needed?

No, once you have changed your username, you cannot revert back to the previous one. Once the change is made, it is permanent. Therefore, it is important to consider this before making any username changes.

How to confirm the success of the username change?

To confirm the success of a username change, you can follow these steps:

  1. Log out of your account: Sign out of the platform or application where you changed your username. This will ensure that you are not logged in with the old username.
  2. Clear cache and cookies: Clear your browser cache and cookies to eliminate any stored data related to your old username. This step is important, especially if you are using a web browser.
  3. Log in with your new username: Go back to the platform or application and log in using your new username and the associated password.
  4. Verify profile settings: Check your profile or account settings to confirm that your new username is displayed correctly. Look for any mentioning of your old username, which should no longer be visible.
  5. Test visibility: If applicable, search for your new username using the platform's search function. Make sure your profile appears in search results with the updated username.
  6. Test interactions: Send a test message, comment, or perform an action that involves your username, and verify that it appears correctly. Check that other users can interact with you using your new username.
  7. Update personal information: Review any connected profiles or accounts outside of the platform to ensure your new username is updated there as well.
  8. Seek feedback: Ask friends, peers, or contacts on the platform to verify that they see your new username correctly when viewing your profile or engaging with your content.

By following these steps, you should be able to confirm the success of your username change.

What happens to the files and directories associated with the old username after changing it?

When you change your username on a computer, such as on Windows or macOS, the files and directories associated with the old username are typically not automatically affected or moved. These files and directories will still exist in their original location unless you manually move or delete them.

However, it's important to note that some system files and settings may still reference the old username. Changing the username primarily affects the login name and user profile, but there might be certain system-related configurations that store the username in a different manner. In such cases, you may need to update or reconfigure those settings manually.

It's always a good practice to back up any important files before changing your username or performing any significant system modifications, just to ensure that your data remains safe.

How to change the Ubuntu username from the command line?

To change the username in Ubuntu from the command line, follow these steps:

  1. Open the terminal by pressing Ctrl+Alt+T.
  2. Log out of your current username, and then log in as the root user. You can log in as root by using the following command:

sudo -i

  1. Use the usermod command to change the username. Replace oldusername with your current username, and newusername with the desired new username. Run the following command:

usermod -l newusername -d /home/newusername -m oldusername

For example, if your current username is oldusername and you want to change it to newusername, the command will be:

usermod -l newusername -d /home/newusername -m oldusername

  1. To change the group name associated with the username, run the following command. Replace newusername and newgroupname with the desired new values:

groupmod -n newgroupname newusername

  1. Update the user's group information by running the following command:

usermod -a -G newgroupname newusername

  1. Exit the root user session by running the following command:

exit

  1. Restart your system for the changes to take effect.

Note: Ensure you have administrative privileges and double-check the command syntax before executing any command in the terminal. Incorrect commands can lead to system issues.

What is the significance of the user ID or UID while changing the username?

The User ID (UID) is a unique numerical identifier associated with each user account in a computer system. It is significant while changing the username because the UID remains the same even if the username is altered. This helps in maintaining the consistency of the user's identity and ensures that all permissions and settings associated with the user account are retained. By keeping the UID constant, the system can link the user's new username to their existing account without disrupting any access rights or privileges they may have. This is particularly useful in multi-user systems where preserving user-specific configurations and access permissions is crucial.

Are there any restrictions or requirements for the new username?

Yes, there are usually certain restrictions or requirements for creating a new username, depending on the platform or service you are using. Some common restrictions may include:

  1. Length: There might be a minimum and maximum character limit for the username.
  2. Special Characters: Some platforms may disallow certain special characters or only allow specific ones to be used.
  3. Unique: The username may need to be unique, meaning that no other user can have the same username.
  4. Inappropriate Content: Platforms usually restrict usernames that contain profanity, offensive language, hate speech, or violate their terms of service.
  5. Reserved Words: Certain words or phrases might be prohibited or reserved by the platform.
  6. Format: Some platforms may require usernames to follow a specific format, such as including a combination of letters, numbers, or both.

It's important to refer to the guidelines or terms of service of the specific platform or service you are creating a username for, as the restrictions and requirements can vary.

Can I change the username while logged in as that user?

It depends on the specific platform or website you are using. Some platforms allow users to change their username while logged in, while others may require additional steps or may not offer this feature at all. You can usually find the option to change your username in the account settings or profile section of the website or application you are using.