If you have forgotten your root password on Ubuntu, you can recover it by following these steps:
passwd
and press enter.reboot
and press enter.Once you have followed these steps, you will be able to log in to your Ubuntu system with your new root password.
For more information on recovering a lost root password on Ubuntu, please refer to the following resources: