Situatie
Kali Linux allows us to enter the username while installing it and it assigns the username a unique user id to identify the user and it assigns the id itself. Now there come situations when we have to change the username or user id.
Solutie
Pasi de urmat
To get the user id of a user
cat /etc/passwd | grep oldusername
Replace the oldusername with the name of the user you want to use
To change the Username. We use usermod command along with -l parameter in order to change the username of a particular user.
usermod -l newusername oldusername
Replace the oldusername with the name of the user you want to change and the newusername with the new name of the user
This command will change the username of the oldusername to the newusername but will not change the files and userID of the user.
To change the UserID we use usermod command along with -u parameter in order to change the userid of a particular user.
usermod -u 1234 newusername
Replace the newusername with the username you want to change the id of. And Replace 1234 with the id you want to set for the user.
Leave A Comment?