1.开机启动项修改

每一个版本都不一样,建议大家直接去搜索

find / -name 'grub.cfg'

搜索出来后对应的进行修改


vi /boot/grub2/grub.cfg

没有更改之前的,里面很多一大串信息

更改之后的

具体修改的部分:

我们只需要保留硬盘引导数据,其他对应的都删除掉:

如下对应添加:default=0 :timeout=1

default=0 (0开始)
timeout=1 (启动延时1S)
menuentry 'CentOS Linux (3.10.0-957.el7.x86\_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry\_id\_option 'gnulinux-3.10.0-957.el7.x86\_64-advanced-8d2ea146-1e54-487c-bde4-15b646442c6a' {
root='hd0,msdos1'
if [ x$feature\_platform\_search\_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1' 973d0434-ff7f-4c84-a659-b4807e084ef0
else
search --no-floppy --fs-uuid --set=root 973d0434-ff7f-4c84-a659-b4807e084ef0
fi
linux16 /vmlinuz-3.10.0-957.el7.x86\_64 root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap LANG=zh\_CN.UTF-8
initrd16 /initramfs-3.10.0-957.el7.x86\_64.img
}
menuentry 'CentOS Linux (0-rescue-a4e3d56ab3284b05bc4d899a1fc6bc25) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry\_id\_option 'gnulinux-0-rescue-a4e3d56ab3284b05bc4d899a1fc6bc25-advanced-8d2ea146-1e54-487c-bde4-15b646442c6a' {
root='hd0,msdos1'
if [ x$feature\_platform\_search\_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1' 973d0434-ff7f-4c84-a659-b4807e084ef0
else
search --no-floppy --fs-uuid --set=root 973d0434-ff7f-4c84-a659-b4807e084ef0
fi
linux16 /vmlinuz-0-rescue-a4e3d56ab3284b05bc4d899a1fc6bc25 root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap
initrd16 /initramfs-0-rescue-a4e3d56ab3284b05bc4d899a1fc6bc25.img
}

2.对应开通启动时我们有命令启动及图形化启动,我们目前安装的为命令启动,但是启动的时候有进度条,我们也可以更改,对应跟关机一样,显示详细信息

打开配置文件:修改位置大致在第99行和第113行位置,删除里面的rhgb quiet

  linux16 /vmlinuz-3.10.0-514.el7.x86_64 root=/dev/mapper/cl-root ro crashkernel=auto rd.lvm.lv=cl/root rd.lvm.lv=cl/swap rhgb quiet LANG=en_US.UTF-8
 linux16 /vmlinuz-0-rescue-d3f7c9792f7c1d930a40afdba2cd28da root=/dev/mapper/cl-root ro crashkernel=auto rd.lvm.lv=cl/root rd.lvm.lv=cl/swap rhgb quiet

如下截图为完整的显示开机的效果:

3.对应启动后欢迎信息的修改 cat /etc/issue

关于/etc/issue,/etc/issue.net,/etc/motd修改中,可以使用如下符号
\d 本地端时间的日期;
\l 显示第几个终端机接口;
\m 显示硬件的等级 (i386/i486/i586/i686…);
\n 显示主机的网络名称;
\o 显示 domain name;
\r 操作系统的版本 (相当于 uname -r)
\t 显示本地端时间的时间;
\s 操作系统的名称;
\v 操作系统的版本

如下为显示的效果

2、SSH登入修改欢迎信息
修改ssh的配置文件/etc/ssh/sshd\_config

vim /etc/ssh/sshd\_config

找到如下信息,设置欢迎信息的文件
Banner /etc/ssh/ssh\_login\_banner

创建该文件并且编辑该文件
vim /etc/ssh/ssh\_login\_banner

添加完欢迎信息后,保存退出,并且重启sshd服务器
systemctl restart sshd.service

如下为效果图:

​​​​​​​Centos7.x启动项及开机信息修改教程

标签: root, Centos7, 开机, 启动项, hint, rd, msdos1, lv

相关文章推荐

添加新评论,含*的栏目为必填