sudo passwd root
In VM or with physical access
Follow these steps if you do not know the root password.
- Reboot the machine
- In GRUB menu, select Advanced options for Kali GNU/Linux
- A list will appear, press E for editing
- Using the arrows, go to the line starting with linux
- Replace ro with rw (changing from read-only to read-write)
- Add init=/bin/bash at the end of the line
- Press F10
- On the command line, enter passwd
- Enter the new password twice
- It should say password udated successfully
- Reboot the computer normally