系统安全

1、RHEL6破解密码:
1.重启系统;
2.读秒按任意键;
3.按e;
4.在kernel行按e;
5.空格 1 回车 按 b;
6.password root;
7.reboot.

 

2、RHEL7破解密码:
1.重启,reboot;
2.在菜单按e;
3.在linux 16行的结尾(end)添加:rd.break
4.ctrl+x
5.mount -o remount,rw /sysroot/
6.chroot /sysroot
7.passwd root
8.touch /.autorelabel
9.exit
10.exit

 

3、防止普通用户破解密码:
vim /boot/groub/groub.conf
在title前一行加入
password 密码


4、进入系统前加密
vim /boot/groub/groub.conf
在title后一行加入
passwd 密码

5、防止其他用户破解密码,用md5方式
groub-md5-crypt
将/boot/groub/groub.conf中改为
passwd --md5 md5的值

6、grub2加密
grub2-mkpasswd-pbkdf2 pbkdf2--加密的算法
生成pkbdf2的密码
将密码黏贴到明文密码位置
vim /etc/grub.d/00_header
结尾计入
cat << EOF
set superusers="zhangsan"
password_pbkdf2 zhangsan grub.pbkdf2.sha512.10000.2E2BD3CC37825233D7E9B08216 5B95421B7E210C4843C03ED733ECCA2CC7F8086B3F83359878CDFD6EA3311574210C3B239445E139E6401C8A66A75400C310F9.C200136A6DE3B2C35CCF894B41E410E1EDA05CC329E40C1A4152F659866AC24A2A47267DE7FE314A1BEA77CACB65EC311BE3EEA70DB8B2E379D95E08DF4CC0F3
EOF
grub2-mkconfig -o /boot/grub2/grub.cfg
systemctl reboot

7、如果 rm -rf /boot/* 如何修复?
需要进入相当于winpe(光盘引导)
光盘引导
进入Troubleshooting模式
选择Resure a Red hat
chroot /mnt/sysimage
mount /dev/cdrom /mnt
cd /mnt/Packages
rpm -ivh kernel-3.1-<tab> --force
grub2-install /dev/sda 重装grub
grub2-mkconfig -o /boot/grub2/grub.cfg
exit
exit

8、grub损坏的修复?
dd if=/dev/zero of=/dev/sda bs=1 count=446
用光盘启动
进入resuce模式
chroot /mnt/sysimage
grub2-install /dev/sda 重建grub
exit
exit

9、如果系统崩溃?
按照损坏的情况,进入相应的模式
如果根损坏 进入resuce mode
根出了问题,要插光盘或用pxe启动,rescue

10、正确关机:
sync将数据由内存同步到硬盘中,避免重启或者关机数据丢失;
shutdown -h 10':10分钟后关机,并且会显示在登陆用户的当前屏幕中;
shutdown -h now:立马关机;
shutdown -h 20:26:系统在今天的25:26关机;
shutdown -h +10:10分钟后关机;
shutdown -r +10:系统立马重启;
reboot=shutdown -r now;
halt=shutdown -h now=poweroff
关机命令:shutdown -h now,halt,poweroff,init 0;
重启命令:shutdown -r now;reboot,init 6.

posted @ 2019-05-30 15:06  那年今日2012  阅读(295)  评论(0编辑  收藏  举报