Change hostname and root password in Kali Linux.

When you install Kali Linux you are given option of choosing hostname/computer name.If you did not choose during installation then default hostname is left to kali.In order to change default hostname we need to modify hostname file inside etc directory.

Changing root password or any other user's password in any Linux distribution is easy.So frist we will change the hostname then we will change password.

Change hostname in kali linux

Open your terminal and type the following command:

root@seven:~# nano /etc/hostname

Above command will open the hostname file and now change the default or previous hostname save and exit.

changed name

Save and exit now reboot your system .

Check your new hostname with the below command :

root@seven:~# hostname

That's it you have changed your hostname or computer name.

Change root password on Kali Linux

In order to change root password we need to type the passwd command.If you dont give any user name along with passwd command then it will change your root password.

Open your terminal and type:

root@seven:~# passwd
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully

Type password carefully when you type password field will not be visible.You will be asked to retype password for confirmation that should be it.Your password will be updated successfully.

In this way you can change password of any user in Linux.If you don't give username after passwd command then by default it changes the root password. To change password of any other user just follow the syntax:

passwd [username that you want to change password of]

root@seven:~# passwd user1

I hope it helped you thanks.