Header AD

How to change hostname and Root Password in Kali Linux?

How to change hostname and Root Password in Kali Linux?
How to change hostname and Root Password in Kali Linux?

How to change hostname and Root Password in Kali Linux?


When you install Kali Linux you are given the 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 the etc directory.
Changing root password or any other user's password in any Linux distribution is easy.So first we will change the hostname then we will change the 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 the root password, we need to type the password command.If you don't give any username along with password 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 the password of any user in Linux.If you don't give username after password command then by default it changes the root password. To change the password of any other user just follow the syntax:
Syntax:
root@seven:~# passwd user1

So above are the How to change hostname and Root Password in Kali Linux?. Hope you like this article, keep on sharing with others too. Also, share your experience with us in a comment box below.

No comments