Set Password (into single-user) of grub menu

. 1, [the root @ localhost ~] # grub2-PBKDF2 the mkpasswd // password-generating password strings

     Enter password:
     the Reenter password:

     grub.pbkdf2.sha512.10000.CAFD1E841CB4C7E790C0AC0ED

     87D7FA64BE75F89C53870A829C35CF35FBE379BA1F10773E2377D6FCBB7EB844FF2C422732A123F

     2D11DB93D3C210EE94FCB0E1.74D4890C925DEA983782126299404F9977517136B67554B9AC3776E9C0F7

     2413ECF7842B35766B9C2424A5E1D43A314AD89EA1BE78DE32C6C1426727AE366153

2, [the root @ localhost ~]} // # CP backup /boot/grub2/grub.cfg{,.bak

3, [root @ localhost ~] # cp // backup /etc/grub.d/00_header /etc/grub.d/00_header.bak

4, [root @ localhost ~] # vim /etc/grub.d/00_header // to file for editing

     cat << EOF
     set superusers="root"
     password_pbkdf2 root grub.pbkdf2.sha512.10000.CAFD1E841CB4C7E790C0AC0ED

     87D7FA64BE75F89C53870A829C35CF35FBE379BA1F10773E2377D6FCBB7EB844FF2C422732A123F

     2D11DB93D3C210EE94FCB0E1.74D4890C925DEA983782126299404F9977517136B67554B9AC3776E9C0F7

     2413ECF7842B35766B9C2424A5E1D43A314AD89EA1BE78DE32C6C1426727AE366153
     EOF

. 5, [the root @ localhost ~] # grub2-mkconfig -o /boot/grub2/grub.cfg     // Use grub2-mkconfig re ⽣ command files into grub.cfg

 

Guess you like

Origin www.cnblogs.com/tanxiaojuncom/p/11331046.html