How To Change Username in Kali Linux | Kali Linux Tutorial

How To Change Username in Kali Linux

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, a Debian-based distro. Here we will rename the current username with the user’s home directory name. So how do change or rename a 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 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.

Set the root Password in Kali Linux

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.

Restart your Kali Linux

Login with root

Now here at the login screen, we have to login with the root user. Using new credentials you can login as root.

Login with root in Kali Linux

Change (rename) the Username and Home Directory

usermod command to change the 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.

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

Change rename the Username and Home Directory

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

Change the Group name in Kali Linux

Create a symbolic link from /home/newusername to /home/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

Create a symbolic link in Kali Linux

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

Change the display name or full name

Restart your Kali Linux

Now after changing the username we need to restart the Kali Linux and Login with new username.

Root Password in Kali Linux

Login with New Username

Now here at the login screen, we have to login with the new username. Using same old username’s credentials.

Change Username in Kali Linux

Video

In this video, I will show How To Change or Rename Username in Kali Linux | Kali Linux 2023.1.

Conclusion:

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.org are only for educational purposes. If you are using and follow this tutorial for any illegal purpose, techdhee.org 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

Finally

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.

Related Post

Leave a Reply

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