Ubuntu article thumbnail image.

How do you change the username for a user on the Ubuntu operating system?

You can do this by using the usermod command native to Ubuntu, which modifies the system account files depending on the options you give it.

The command for updating a user's username would look like this:

sudo usermod -l new_username current_username

The name of the current user (current_username) will be changed to new_username.

When you run this command, nothing else is changed on your machine. Therefore, you should manually rename the user's /home directory to reflect the new username.

You can read more about the usermod command in the Ubuntu manual.

Thanks for reading!

About the author

Hi, I'm Nick Major. I'm a software developer from Wisconsin, United States.

I create free and premium courses, have published hundreds of informational coding articles, and am currently a Frontend Software Engineer at RoundingWell.

You can read more about me here.

Picture of Nick Major.