今天遇到一件囧事,長時間不進windows環境結果把自己設定的密碼給忘記了,于是便發了一條微網誌。熱心朋友一大堆,給我推薦各種各樣的方法,自己也到網上搜了一搜,原來在linux下去除windows的密碼是那麼簡單。方法步驟如下:
一、安裝工具chntpw
這個工具應該在各大發行版的官源裡都存在(linux對windows的安全環境考慮真是沒得說。==!)。直接用你的發行版裡最常用的安裝方式安裝即可。
比如archlinux– sudo pacman -s chntpw
二、使用工具
挂載windows系統分區盤,進入到 windows/system32/config中,就地打開終端,運作如下指令:
sudo chntpw sam
會得到如下提示:
chntpw version 0.99.6 110511 , (c) petter n hagen hive name (from header): root key at offset: 0×001020 * subkey indexing type is: 666c file size 262144 [40000] bytes, containing 5 pages (+ 1 headerpage) used for data: 233/17736 blocks/bytes, unused: 16/2584 blocks/bytes. * sam policy limits: failed logins before lockout is: 0 minimum password length : 0 password history count : 0 | rid -|———- username ————| admin? |- lock? –| | 01f4 | administrator | admin | *blank* | | 01f5 | guest | | dis/lock | ———————> syskey check <———————– system secureboot : -1 -> not set (not installed, good!) sam accountf : 0 -> off security polsecretencryptionkey: -1 -> not set (ok if this is nt4) syskey not installed! rid : 0500 [01f4] username: administrator fullname: comment : ���:(�)��n7 homedir : user is member of 1 groups: 00000220 = administrators (which has 1 members) account bits: 0×0210 = [ ] disabled | [ ] homedir req. | [ ] passwd not req. | [ ] temp. duplicate | [x] normal account | [ ] nms account | [ ] domain trust ac | [ ] wks trust act. | [ ] srv trust act | [x] pwd don’t expir | [ ] auto lockout | [ ] (unknown 0×08) | [ ] (unknown 0×10) | [ ] (unknown 0×20) | [ ] (unknown 0×40) | failed login count: 0, while max tries is: 0 total login count: 81 ** no nt md4 hash found. this user probably has a blank password! ** no lanman hash found either. sorry, cannot change. try login with no password! - – - – user edit menu: 1 – clear (blank) user password 2 – edit (set new) user password (careful with this on xp or vista) 3 – promote user (make user an administrator) (4 – unlock and enable user account) [seems unlocked already] q – quit editing user, back to user select select: [q] >
很顯然,選1清除密碼;選2重設密碼;選3不知不覺提升使用者權限,哈哈;選4啟用或者關閉某個使用者。我果然選1,重新開機進入windows一路無阻!
<b> 原文釋出時間為:2013-05-29</b>
<b>本文來自雲栖社群合作夥伴“linux中國”</b>