栏目导航: 首页 > 检测提权 > 加密破解 > 内容

linux单用户密码破解

www.hx99.net    时间: 2015-03-26    阅读: 次     整理: 华西安全网

 ubunt

1,开机到grub时,用上下键移到第二行的恢复模式,按e(注意不是回车)
即Ubutn,kernel 2.6.12-9-386(recovery mode)
2,把ro single 改成rw single init=/bin/bash      然后按ctrl+x 

RHEL 6/centos 6 
1. grub
进入启动画面之后,敲入“e”,把光标移动到kernel ...那一行,再敲入“e”,在kernel 一行的最后加上空格single,回车
敲入“b”,启动系统,即进入单用户模式,
这个时候就可以用passwd命令改密码了。
passwd root
改完以后reboot重启。
2. lilo
进入lilo命令行模式,敲入linux single,即进入单用户模式。



REHL7/Centos 7 (grub2)
If you have lost or forgot root password of RHEL7, you can follow this step to change to a new password, this is different with the RHEL6  single-usermode,


1, press e button in GRUB 2 boot screen.
2, at the end of Linux line add init=/bin/sh and remove 'rhgb' and 'quiet'
3, Ctrl+x to boot the system with the parameter
4, remount the file system as writable, run the mount -o remount, rw / command
5, passwd to change password.
6, make sure SELinux context of the files that were modified is restored, touch /.autorelabel
7, last step, resume the initialization and finish the system boot. exec /sbin/init

1. 添加init=/bin/sh  移除'rhgb' and 'quiet'
2. Ctrl+x
3. mount -o remount, rw /
4. passwd 
5. touch /.autorelabel {selinux 开启时}
6. exec /sbin/init
7. 进入单用户显示乱码使用:LANG=zh-cn.utf8

本文来源:华西安全网[http://www.hx99.net]
发表评论】【告诉QQ好友】【错误报告】【加入收藏】【关闭