今天遇到一件囧事,長時間不進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很顯然,選1清除密碼;選2重設密碼;選3不知不覺提公升使用者許可權,哈哈;選4啟用或者關閉某個使用者。我果然選1,重啟進入windows一路無阻!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] >
原文發布時間為:2013-05-29
linux下去除空行的方法
有時當進行某些配置檔案的檢視時,分去除注釋 如 但之後還會發現中間也許會有好多空行,所以,現小結一下去除空行的方法。1 用tr命令 grep v etc snmp snmpd.conf tr s n 2 用sed命令 grep v etc snmp snmpd.conf sed d 3 用awk命令...
linux下去除空行的方法
有時當進行某些配置檔案的檢視時,分去除注釋 如 但之後還會發現中間也許會有好多空行,所以,現小結一下去除空行的方法。1 用tr命令 grep v etc snmp snmpd.conf tr s n 2 用sed命令 grep v etc snmp snmpd.conf sed d grep v e...
Winform下去除MDI窗體邊框
做專案中間遇到了mdi窗體內邊框的問題,經過苦苦尋找,最終得到了解決方案 在main窗體中呼叫api win32 constants private const int gwl style 16 private const int gwl exstyle 20 private const int w...