一、忘记管理员密码怎么破解呢?
红帽6的系统:
第一步:看到引导菜单按e键进行编辑
第二步:编辑内核
第三步:进入单用户级别模式
回车退出,然后按b键启动系统
第四步:修改密码
红帽7的系统破解密码:
第一步:编辑引导界面的grub
第二步:编辑
找到linux16这一行,在行尾加上rd.break,然后按ctrl+x启动系统
第三步:修改密码
1)mount -o remount,rw /sysroot //重新挂载根目录
2)chroot /sysroot //切换到根目录
3)修改root密码
4)touch /.autorelabel //创建一个selinux所需要的文件夹
5)输入两次exit退出
给grub菜单加密
第一步:生成密码
第二步:编辑grub文件
在文件的最后一行添加一下信息:
第三步:重读grub文件,并重启验证
输入用户名和密码:
进入成功:
磁盘损坏的修复
我们使用dd命令模拟磁盘被损坏来进行修复操作
1)创建分区,格式化文件系统,挂载并拷贝一些文件到目录中
分区
[root@www ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 20G 0 disk
├─sda1 8:1 0 500M 0 part /boot
└─sda2 8:2 0 19.5G 0 part
├─centos-root 253:0 0 17.5G 0 lvm /
└─centos-swap 253:1 0 2G 0 lvm [SWAP]
sdb 8:16 0 10G 0 disk
└─sdb1 8:17 0 5G 0 part
sr0 11:0 1 4G 0 rom
[root@www ~]#
[root@www ~]#
[root@www ~]#
[root@www ~]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): n
Partition type:
p primary (1 primary, 0 extended, 3 free)
e extended
Select (default p):
Using default response p
Partition number (2-4, default 2):
First sector (10487808-20971519, default 10487808):
Using default value 10487808
Last sector, +sectors or +size{K,M,G} (10487808-20971519, default 20971519):
Using default value 20971519
Partition 2 of type Linux and of size 5 GiB is set
Command (m for help): w
The partition table has bee