天天看点

Linux下去除windows密码

今天遇到一件囧事,长时间不进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>

继续阅读