How to change the grub password

01. Login as root

02. create an new encrypted password for grub
Password: ****** (uddika)
Encrypted: $1$ZWnke0$1fzDBVjUcT1Mpdd4u/T961 (encrypted password)

03. copy the new encrypted password by highlighting it using the mouse

04. Open the grub configuration file for editing
#nano /etc/grub.conf

05. Find this line
password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/

06. Replace with the following line (Right click the mouse to paste new password)
password --md5 $1$ZWnke0$1fzDBVjUcT1Mpdd4u/T961 (encrypted password above)

07. Save this file
Ctrl + O

08. Exit the file
Ctrl + X