LInux的GRUB進行MD5加密

來源:互聯網
上載者:User

1,在自己的終端下grub-md5-crypt ,在出現的Passwd:提示時候輸入你的密碼(注意,在Linux下輸入密碼都是不顯示的),Retype password:時再次輸入密碼。我們這裡用123456來示範。
[zyj
@fedora13 ~]$ grub-md5-crypt
Password:
Retype password:
$1$GpGkm/$nO0Gm4nYm.zno7myl.rgP0
這裡得到的就是將密碼123456加密後的字串,這一定要記下來,後邊有用。
2,修改設定檔/etc/grub.conf
  修改設定檔時,採用vi編輯器,這裡一定要用超級使用者,因為普通使用者權限不夠。
下邊是未加密的原設定檔:
default=0
timeout=4
splashimage=(hd0,2)/boot/grub/splash.xpm.gz
title Fedora (2.6.34.7-56.fc13.i686.PAE)
        root (hd0,2)
        kernel /boot/vmlinuz-2.6.34.7-56.fc13.i686.PAE ro
root=UUID=4a60f9c2-0eae-4c55-b294-60bc90f391cd rd_NO_LUKS rd_NO_LVM
rd_NO_MD rd_NO_DM LANG=zh_CN.UTF-8 KEYTABLE=us rhgb quiet
        initrd /boot/initramfs-2.6.34.7-56.fc13.i686.PAE.img
title Windows 7
        rootnoverify (hd0,0)
        chainloader +1
這設定檔我就不一一介紹了,下邊我們看將經過MD5加密的字串加在設定檔的什麼地方。下邊是修改過後的設定檔:
default=0
timeout=4
splashimage=(hd0,2)/boot/grub/splash.xpm.gz
password --md5 $1$GpGkm/$nO0Gm4nYm.zno7myl.rgP0
title Fedora (2.6.34.7-56.fc13.i686.PAE)
lock
        root (hd0,2)
        kernel /boot/vmlinuz-2.6.34.7-56.fc13.i686.PAE ro
root=UUID=4a60f9c2-0eae-4c55-b294-60bc90f391cd rd_NO_LUKS rd_NO_LVM
rd_NO_MD rd_NO_DM LANG=zh_CN.UTF-8 KEYTABLE=us rhgb quiet
        initrd /boot/initramfs-2.6.34.7-56.fc13.i686.PAE.img
title Windows 7
        rootnoverify (hd0,0)
        chainloader +1
這裡加入lock的意思是鎖住Fedora,在啟動的時候就會出現錯誤提示,要求按 p 輸入密碼。
就這樣簡單的進行了GRUB 的MD5加密咯,是不是很簡單,你可以自己動手試一試咯!!!

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.