In this article, we are going to learn how to change the username in Linux. Yes, how to change the username in Kali Linux and Ubuntu, Debian-based distro. Here we will rename the current username with the user’s home directory name. So how to change or rename username in Kali Linux, Ubuntu or Debian Based Distro let’s start. In this tutorial, I am using Kali Linux as the base distro.
Set the root Password
So first of all we have to enable the root User in the Kali Linux. We have to set the root password and then we have to login with the root user to change the user’s name.
Restart your Kali Linux
Now after setting the root password we need to restart the Kali so all the services stop which is running on your Users.
Login with root
Now here at the login screen, we have to login with the root user. Using new credentials you can loin as root.
Change (rename) the Username and Home Directory
usermod command to change username under a Linux operating system. This command modifies the system account files to reflect the changes that are specified on the command line. This command to change your username and home directory. If you get an error about a process being in use for the old user name, kill that process (kill PID). Open a terminal and run these command to change your username and home directory from oldusername to newusername.
# usermod -l newusername -d /home/newusername -m oldusername
Change (rename) the Group name
groupmod command to change group name under a Linux operating system. Type the following command change the group name.
# groupmod -n newusername oldusername
Some applications will show errors when we change the username because in some cases there are configuration files that point to the old username’s home directory. A solution for this is to create a symbolic link from the new home directory to the old home directory:
# ln -s /home/newusername /home/oldusername
Change the display name or full name
Replace the first name and last name with your first and last name, or whatever you want to show up on the login screen and various other places throughout the system. The following command changes your old full name to the new one.
# chfn -f "FIRSTNAME LAST NAME" newusername
Restart your Kali Linux
Now after changing the username we need to restart the Kali Linux and Login with new username.
Login with New Username
Now here at the login screen, we have to login with the new username. Using same old username’s credentials.
In this video, I will show How To Change or Rename Username in Kali Linux | Kali Linux 2021.1.
Change the username or rename the username in Kali Linux is easy. But you can create a new user account also. You can create a new account with low privileges which are used by another person who uses your computer. If you are getting any errors to follow this tutorial please feel free to comment below.
Important Things To Remember:
The author of this article does not promote any illegal activities It is just for education purpose All the activities provided in this article, YouTube channel, and on the website techdhee.in are only for educational purposes.
If you are using and follow this tutorial for any illegal purpose, techdhee.in can not be responsible for your action.
My purpose is to educate or share the information who have not, how to secure your self from the Internet, and the world of digital.
Also, read the Disclaimer
Thank you for reading this post and keep connected to TECH DHEE to continue enjoying excellent posts. Share your views about this post in the comment section below. If you still have any queries, throw it in the comment section. If you find this post helpful, don’t hesitate to share this post on your social network. It will only take a moment, and also it is quite easy and useful for others.
- How To Make root User Terminal colorful in Kali Linux 2020.1
- Best way to Install Kali Linux 2020.1 on Virtual Box
- How To Get root Access and root Account Login into Kali Linux 2020.1
- Top 10 Kali Linux Tools for Hacking and Penetration Testing
- The First 5 Things to Do After Installing Kali Linux
- How to Install Tor Browser in Kali Linux
- Install MITMf Framework in Kali Linux