Linux如何清除系统密码,Linux清除Windows密码

记录在Linux下清除Windows密码的过程。

下载安装ntfs-3g

下载驱动让Linux挂载Windows磁盘

https://tuxera.com/opensource/ntfs-3g_ntfsprogs-2017.3.23.tgz

安装

tar -xvf ntfs-3g_ntfsprogs-2017.3.23.tgz

cd ntfs-3g_ntfsprogs-2017.3.23

./configure

make

make install

下载安装chntpw

下载chntpw

https://pkgs.org/download/chntpw

wget http://li.nux.ro/download/nux/dextop/el7/x86_64//chntpw-0.99.6-22.110511.el7.nux.x86_64.rpm

yum -y install ./hntpw-0.99.6-22.110511.el7.nux.x86_64.rpm

挂载windows磁盘

挂载windows的系统盘

默认第二个分区才是C盘

mkdir /win

mount -t  ntfs-3g /dev/xvdb2 /win

备份SAM文件

cd /win/Windows/System32/config/

cp SAM{,.bak}

清除Windows密码

chntpw SAM

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                        # 1 清除密码

Password cleared!

Hives that have changed:

#  Name

Write hive files? (y/n) [n] : y        # y保存

0  - OK

将Windows系统盘重新挂载回windows中即可

0b1331709591d260c1c78e86d0c51c18.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值