Setting ‘root’ Password for Centos.
Today my friend was having an issue where he was not able to set ‘root’ password.
As the default installation had a default account without “sudo” privilege.
To set the “root” password for Cent OS Follow below steps.
1. In the grub boot menu prompt – enter “e” (for edit) to edit boot parameters.
2. Select menu this will bring up 3 or more based on the installation type. root, kernel, initrd
kernel /vmlinuz-2.6.8-1.523 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
3. Select “kernel /vmlinuz-2.6.8-1.523 ro root=/dev/VolGroup00/LogVol00 rhgb quiet” and press “e” for edit
4. Now add “single” at the end of the line (<space> single) as you see like the above line and press <enter>
5. Now at the boot menu enter “b” for boot
6. This will bring the system up in single user mode.
7. Enter “passwd root” >> Change your root password.