前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >linux系统启动相关

linux系统启动相关

作者头像
陪你听风
发布2021-03-31 23:58:22
2.4K0
发布2021-03-31 23:58:22
举报
文章被收录于专栏:陪你听风陪你听风

1.grub参数的修改

grub配置文件/boot/grub2/grub.cfg 一般不会修改此配置文件 修改/etc/default/grub文件后,使用命令生成grub.cfg配置文件 grub2-mkconifg -o /boot/grub2/grub.cfg 2.grub不同的模式

救援模式rescue,需要root密码 类似于windows下的安全模式 在启动参数后添加1或者s或者single

紧急模式emergency 需要root密码 类似于windows下的安全模式 在启动参数后添加 emergency

fsck /dev/sdb1 3.重置root密码

开机修改grub参数(7.0需要删除 rhgb quiet) e编辑 linux最后一行添加 init=/bin/sh

ctrl + X mount -o rw,remount /

修改密码 echo redhat |passwd --stdin root 重置selinux上下文 touch /.autorelabel

重启系统 exec /sbin/init

4.对grub加密

vim /etc/grub.d/00_header 1.普通加密,密码不加密 vim /etc/grub.d/00_header

cat <<EOF set superusers="tom" password tom redhat EOF

grub2-mkconifg -o /boot/grub2/grub.cfg

2.密码加密

grub2-mkpasswd-pbkdf2 生成密码

cat <<EOF set superusers="tom" password tom 生成的密码 EOF grub2-mkconifg -o /boot/grub2/grub.cfg

5.开机启动各种服务 修改/etc/rc.d/rc.local chmod u+x /etc/rc.d/rc.local

6.引导程序修复 使用光盘记载引导系统,进入救援模式WINPE grub损坏

/mnt/sysimage

chroot /mnt/sysimage grub2-install /dev/sda exit退出重启

boot文件丢失 mount /dev/cdrom /mnt/sysimage rpm -ivh /mnt/Package/kernel*.rpm --force

mkdir /boot/grub2 grub2-mkconifg -o /boot/grub2/grub.cfg grub2 /dev/sda

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2019年7月11日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档