On Tue, Jan 17, 2023 at 09:36:03AM +0100, steve wrote: > Easier would be to delete the second field in /etc/shadow for root, so there > won't be anymore root password (it's empty). You can then create one with the > 'passwd' command.
If you can edit the /etc/shadow file, you're already root, which means you can simply run "passwd root" to set a new password. You will not be prompted for the old password, so there's no need to clear the old password hash preemptively.