How-to-simply...

Reset root password by editing shadow file on Linux

  • 1 Backup current file:
    cp /run/media/bob/disk/etc/shadow /run/media/bob/disk/etc/shadow.bak
  • 2 Generate new password:
    perl -e 'print crypt("N3wPassw0rd","\$6\$salt\$") . "\n"'
  • N $6$ means SHA-512

References