How to change username in Ubuntu 18.04 | 20.04

How to change username in Ubuntu 18.04 20.04

This post shows users and new students that How to change username in Ubuntu 18.04 | 20.04. If you wish to change username in Ubuntu then this post is ideal for you.

Ubuntu is a Linux Operating System based on Debian and mostly composed of non-profit(free) and open-source software. It is a complete Linux operating system that compatible with desktops, laptops, server and other devices. Ubuntu is Open Source so it is freely available for both community and professional support.

Linux is an operating system, like Windows OS, iOS, and Mac OS. Linux is one of the most popular operating system on the planet, Android is also powered by Linux OS(operating system). An operating system is software that manages all hardware resources associated with desktop or laptop. In simple words, the OS(operating system) manages communication between software and hardware.

If you are a learner and looking for a Linux distribution for Learning then Ubuntu Linux Operating System is best for you as a beginning.

Please follow below steps to start changing your Ubuntu Username :

Restart in recovery mode

For change your username in Ubuntu if you are not logged in then simply restart Ubuntu in recovery mode and go to the root prompt shell “Drop to root shell prompt

To login to recovery mode, after powering it on, quickly press the Shift or Escape key.

At the GNU GRUB screen, choose “Advanced options for Ubuntu

Ubuntu recovery mode

Then select Ubuntu recovery mode (the second line).

Ubuntu recovery mode

Now select root (Drop to root shell prompt):

change username in Ubuntu

Type these commands in the root prompt:

Change the username

Firstly re-mount the root:

mount -o remount,rw /

For change the username and home folder name simply replace the newname with the ‘new username’ and oldname with the ‘current username’.

Display Name is the name which shows on the logon screen, so change it according what name you want show on logon screen.

sudo -- usermod -c "Display Name" -l newname -d /home/newname -m oldname

You also need to change group name. The newgroup is the same as your username and oldgroup is the same as your current username.

sudo --  groupmod -n newgroup oldgroup

When you are done all above steps then reboot by below command :

sudo reboot

That’s all

*IMPORTANT*PLEASE DO NOT DO THIS IF YOUR HOME DIRECTORY IS ENCRYPTED.

If you find any error and issue in above steps , please use comment box below to report.

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.