Windows XP Windows 7 Windows 2003 Windows Vista Windows教程綜合 Linux 系統教程
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟件教程
 Windows教程網 >> Linux系統教程 >> Linux系統常見問題解答 >> linux root密碼忘記了,如何找回來?

linux root密碼忘記了,如何找回來?

日期:2017/1/20 17:44:32      編輯:Linux系統常見問題解答

<span style="color: rgb(0, 0, 0); font-family: Tahoma, 'Microsoft Yahei', Simsun; font-size: 14px; line-height: 25px;">&nbsp; &nbsp;好久沒有玩LINUX了,今天小編公司的服務器掛了,就進去看看,可惡的是小編忘記了公司服務器的密碼了,還是LINUX的呢,麻煩出來了,怎麼辦呢?小編就研究了一下,一個早上才知道怎麼找回來,下面就介紹到3種方法可以找回來的,具體如下:</span> <div style="word-wrap: break-word; color: rgb(0, 0, 0); font-family: Tahoma, 'Microsoft Yahei', Simsun; font-size: 14px; line-height: 25px;"> <p style="word-wrap: break-word; margin: 0px; padding: 0px;"><a href="http://www.dnzsb.com/plugin.php?id=iplus_seolinks:links&amp;url=ZGF0YS9hdHRhY2htZW50L3BvcnRhbC8yMDE0MDIvMjYvMjE1NDIyazN4cWM3N2V4NHBlcWlweS5wbmc=" style="word-wrap: break-word; color: rgb(51, 51, 51); text-decoration: none;" target="_blank"><img src=/uploads/allimg/140303/134RT345-0.png" style="word-wrap: break-word; border: none; max-width: 620px;" /></a></p> <div style="word-wrap: break-word;"> <p style="word-wrap: break-word; margin: 0px; padding: 0px; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 24px;"><strong style="word-wrap: break-word; margin: 0px; padding: 0px;">linux root密碼找回方法一</strong></p> <p style="word-wrap: break-word; margin: 0px; padding: 0px; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 24px;">  

第1步:用grub引導系統時:在出現grub畫面時,用上下鍵選中你平時啟動linux的那一項(別選dos喲),然後按e鍵</p> <p style="word-wrap: break-word; margin: 0px; padding: 0px; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 24px;">  

第2步:再次用上下鍵選中你平時啟動linux的那一項(類似於kernel /boot/vmlinuz-2.4.18-14 ro root=LABEL=/),然後按e鍵</p> <p style="word-wrap: break-word; margin: 0px; padding: 0px; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 24px;">  

第3步:修改你現在見到的命令行,加入single,結果如下:</p> <p style="word-wrap: break-word; margin: 0px; padding: 0px; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 24px;">  kernel /boot/vmlinuz-2.4.18-14 single ro root=LABEL=/ single</p> <p style="word-wrap: break-word; margin: 0px; padding: 0px; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 24px;">  

第4步:回車返回,然後按b鍵啟動,即可直接進入linux命令行.</p> <p style="word-wrap: break-word; margin: 0px; padding: 0px; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 24px;">  

第5步:使用以下命令&ldquo;vi /etc/shadow&rdquo;將第一行,即以root開頭的一行中root:後和下一個:前的內容刪除,第一行將類似於root::......保存</p> <p style="word-wrap: break-word; margin: 0px; padding: 0px; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 24px;">  vi /etc/shadow</p> <p style="word-wrap: break-word; margin: 0px; padding: 0px; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 24px;">  

第6步:reboot重啟,root密碼為空。</p> <p style="word-wrap: break-word; margin: 0px; padding: 0px; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 24px;">&nbsp;</p> <p style="word-wrap: break-word; margin: 0px; padding: 0px; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 24px;"><strong style="word-wrap: break-word; margin: 0px; padding: 0px;">linux root密碼找回方法二</strong></p> <p style="word-wrap: break-word; margin: 0px; padding: 0px; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 24px;">  

第1步:在系統進入單用戶狀態,直接用passwd root去更改。</p> <p style="word-wrap: break-word; margin: 0px; padding: 0px; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 24px;">  

第2步:用安裝光盤引導系統,進行linux rescue狀態,將原來/分區掛接上來,作法如下:</p> <p style="word-wrap: break-word; margin: 0px; padding: 0px; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 24px;">  cd /mnt mkdir hd mount -t auto /dev/hdaX(原來/分區所在的分區號) hd cd hd chroot ./ passwd root</p> <p style="word-wrap: break-word; margin: 0px; padding: 0px; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 24px;">&nbsp;</p> <p style="word-wrap: break-word; margin: 0px; padding: 0px; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 24px;"><strong style="word-wrap: break-word; margin: 0px; padding: 0px;">linux root密碼找回方法三</strong></p> <p style="word-wrap: break-word; margin: 0px; padding: 0px; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 24px;">  

第1步:在系統進入單用戶狀態,直接用passwd root去更改。</p> <p style="word-wrap: break-word; margin: 0px; padding: 0px; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 24px;">  

第2步:用安裝光盤引導系統,進行linux rescue狀態,將原來/分區掛接上來,作法如下:</p> <p style="word-wrap: break-word; margin: 0px; padding: 0px; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 24px;">  cd /mnt mkdir hd mount -t auto /dev/hdaX(原來/分區所在的分區號) hd cd hd chroot ./ passwd root</p> <p style="word-wrap: break-word; margin: 0px; padding: 0px; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 24px;">  

第3步:將本機的硬盤拿下來,掛到其他的linux系統上,</p> </div> </div> <br />

Copyright © Windows教程網 All Rights Reserved