灯火互联
管理员
管理员
  • 注册日期2011-07-27
  • 发帖数41778
  • QQ
  • 火币41290枚
  • 粉丝1086
  • 关注100
  • 终身成就奖
  • 最爱沙发
  • 忠实会员
  • 灌水天才奖
  • 贴图大师奖
  • 原创先锋奖
  • 特殊贡献奖
  • 宣传大使奖
  • 优秀斑竹奖
  • 社区明星
阅读:8119回复:0

linux单用户密码破解

楼主#
更多 发布于:2015-03-25 13:34
来源:Linux系统中文网  
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

喜欢0 评分0
游客

返回顶部