Generate grub passwords to prevent strangers from entering single-user mode

Source: Internet
Author: User
Tags crypt

    • Non-plaintext password generation
 
   
  
  1. grub-crypt
  2. # 生成sha加密方式的密码
  3. grub-crypt --md5
  4. # 生成md5加密方式的密码
    • Configuration
      Paste the generated password into/etc/grub.conf, in the following format (password position ):
  
 
  1. # grub.conf generated by anaconda
  2. #
  3. # Note that you do not have to rerun grub after making changes to this file
  4. # NOTICE: You have a /boot partition. This means that
  5. # all kernel and initrd paths are relative to /boot/, eg.
  6. # root (hd0,0)
  7. # kernel /vmlinuz-version ro root=/dev/sda3
  8. # initrd /initrd-[generic-]version.img
  9. #boot=/dev/sda
  10. default=0
  11. timeout=5
  12. splashimage=(hd0,0)/grub/splash.xpm.gz
  13. hiddenmenu
  14. # 此处为加密的密码,--sha和--md5用来说明加密方式
  15. password --sha $6$vRBcWIqOLylJpTex$v80lPovSU/F5C.tpDM5zQbhYJjHGFSlAHhFC.7cEBHiBqA3W/v/HGbasdxFBWNyOdWGQ.3Wzxi4mBgmAOpRes1
  16. title CentOS 6 (2.6.32-573.el6.x86_64)
  17. root (hd0,0)
  18. Kernel/Vmlinuz-2.6. +-573.el6.x86_64 ro Root=UUID=94f2979f-d553-4ffa-Ba52-fc2a84e00312 nomodeset Rd_no_luks keyboardtype=pc KEYTABLE=US LANG=en_US.UTF-8RD_NO_MD Sysfont=Latarcyrheb-Sun16 Crashkernel=AutoRD_NO_LVM rd_no_dm rhgb quiet
  19. initrd /initramfs-2.6.32-573.el6.x86_64.img


From for notes (Wiz)

Generate grub passwords to prevent strangers from entering single-user mode

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.