一.開機流程
1.Centos6

1.打開電源首先通過內(nèi)核引導開機,然后讀入/boot目錄下的內(nèi)核文件。
? ? 2.讀取init程序的配置文件。(/etc/inittab)
? ? 3.選擇運行級別。(查看運行級別 runlevel)0:關機? 6:重啟? 3:字符界面? 5:圖形界面? ? 2:暫未使用 4:暫未使用? 1:單用戶模式(超級權(quán)限,必須面對實體硬件,不可遠程操控)
? ? 4.啟動/etc/init.d/中的服務
? ? 5.建立終端,用戶登錄
? ? 6.進入shell系統(tǒng)
PS:Centos6想要永久更改運行等級的話可以編輯/etc/inittab實現(xiàn)。
2.Centos7

3.Centos6與Centos7的區(qū)別

二.什么是運行級別

[root@neimengJay ~]# systemctl get-default
multi-user.target(3字符界面)
(查看當前運行級別)
[root@neimengJay ~]# systemctl set-default multi-user.target
(修改系統(tǒng)下次啟動時候的運行級別)
[root@neimengJay ~]# systemctl get-default
multi-user.target
(查看當前運行級別)
(multi-user.target ,3,字符界面)
三.systemd使用方法
[root@zy ~]# systemctl disabled httpd.service? (取消開機自啟)
[root@zy ~]# systemctl enable httpd.service? (開機自啟服務)
[root@zy ~]# systemctl restart httpd.service (重啟服務)
[root@zy ~]# systemctl status httpd.service (查看服務狀態(tài))
[root@zy ~]# systemctl start httpd.service? ? (開啟服務)
[root@zy ~]# systemctl stop? httpd.service? ? ? (關閉服務)
【服務狀態(tài)】

四.單用戶模式,超級權(quán)限必須面對實體硬件,不支持遠程控制。
1.使用單用戶模式修改系統(tǒng)密碼

(重啟Linux系統(tǒng)主機并出現(xiàn)引導界面時,按照提示按"e"鍵進入內(nèi)核編輯模式)

(一直下翻,找到linux16的行,UTF-8后加enforcing=0 init=/bin/bash)

(按下ctrl+x來運行修改過的內(nèi)核程序)

(今日單用戶模式依次輸入以上命令,等待系統(tǒng)重啟操作完畢,然后就可以使用新密碼來登錄Linux系統(tǒng)了)
詳細可參考:https://mp.weixin.qq.com/s/1f-zCq8j4gL3xiB3AV9K3A
五.Linux下救援模式