linux下忘記root密碼解決方法

Centos-root密碼忘記解決辦法 以centos 5.6爲例 centos

1.在開機啓動的時候能看到引導目錄Booting CentOS(2.6.18-238.el5) in 3 seconds ...時,而後按「e」。ui

2.接下來你能夠看到下一個畫面,選擇「CentOS(2.6.18-238.el5),而後按」e" token

3.接下來你能夠看到另個畫面,有三個選項   root(hd0,0)   kernel /vmlinuz-2.6.18-238.el5 ro root=LABEL= rhgb quiet   initrd /initrd-2.6.18-238.el5.img   使用上下光標鍵,選擇第二個(kernel /vmlinuz-2.6.18-238.el5 ro root=LABEL= rhgb quiet),而後按「e" it

4.執行完上步操做後能夠看到下面的畫面grub edit>kernel /vmlinuz-2.6.18-238.el5 ro root=LABEL=/ rhgb quiet,在rhgb quiet後加 「空格」,而後鍵入「single」,或者直接輸入  數字的「1」並回車肯定。 io

5.操做上步完,出現以下畫面   root(hd0,0)   kernel /vmlinuz-2.6.18-238.el5 ro root=LABEL= rhgb quiet 1   initrd /initrd-2.6.18-238.el5.img   光標默認選擇第二項。  date

6.按「b」鍵,從新引導系統。 密碼

7.從新引導系統後,屏幕顯示sh-3.2#,光標停留在後面,而後輸入:passwd root命令。   changing password for user root.   new UNIX password:(輸入新密碼)   Retype new UNIX password:(第二次輸入新密碼)   兩次密碼輸入一致後,屏幕出現:passwd :all authentication tokens updated successfully.   sh-3.2#在光標後輸入:reboot從新引導系統便可。im

相關文章
相關標籤/搜索