天天看點

RHEC考試技巧--開機啟動詳細介紹

一:Linux登陸系統時啟動腳本的次序

/etc/profile

/root/.bash_profile

/root/.bashrc

/etc/bashrc

二:給vim添加顔色

進入vi後輸入ESC :syntax enable

三:進入單使用者模式不用輸入root密碼reboot後進入grub畫面輸入a然後在append後面輸入1就進入單使用者模式了

以上的進入模式不安全,下面我們就用grub設定進入單使用者模式的密碼

首先打開/boot/grub/grub.conf

# grub.conf generated by anaconda

#

# Note that you do not have to rerun grub after making changes to this file

# NOTICE:  You have a /boot partition.  This means that

#          all kernel and initrd paths are relative to /boot/, eg.

#          root (hd0,0)

#          kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00

#          initrd /initrd-version.img

#boot=/dev/sda

default=0

timeout=5

splashimage=(hd0,0)/grub/splash.xpm.gz

hiddenmenu

title Red Hat Enterprise Linux AS (2.6.9-42.EL)

        root (hd0,0)

        kernel /vmlinuz-2.6.9-42.EL ro root=/dev/VolGroup00/LogVol00 rhgb quiet

        initrd /initrd-2.6.9-42.EL.img

原始檔案我們隻要在splashimage=(hd0,0)/grub/splash.xpm.gz後面加入

passwd redhat就可以了最後别忘記修改檔案屬性其他人不能檢視啊,不然白費。。

當然這裡的密碼是明文的,我們同時可以使用grub-md5-crypt使用加密的md5,就算有檢視的權限也不能很順利的知道密碼了-。 -

但是這裡和以前有不同的就是輸入passwd --md5 加密的md5就ok了

四:/etc/rc.d/rc*.d/目錄下的檔案格式

lrwxrwxrwx   1 root root   13 Jan  2 19:23 K35smb -> ../init.d/smb

lrwxrwxrwx   1 root root   19 Jan  2 19:26 K35vncserver -> ../init.d/vncserver

lrwxrwxrwx   1 root root   17 Jan  2 19:54 K35winbind -> ../init.d/winbind

lrwxrwxrwx   1 root root   16 Jan  2 19:20 K50ibmasm -> ../init.d/ibmasm

lrwxrwxrwx   1 root root   17 Jan  2 19:21 K50netdump -> ../init.d/netdump

lrwxrwxrwx   1 root root   13 Jan  2 19:21 K50tux -> ../init.d/tux

lrwxrwxrwx   1 root root   16 Jan  2 19:54 K73ypbind -> ../init.d/ypbind

lrwxrwxrwx   1 root root   14 Jan  2 19:54 K74nscd -> ../init.d/nscd

lrwxrwxrwx   1 root root   14 Jan  2 20:09 K74ntpd -> ../init.d/ntpd

lrwxrwxrwx   1 root root   15 Jan  2 19:21 K85mdmpd -> ../init.d/mdmpd

lrwxrwxrwx   1 root root   16 Jan  2 19:17 K87auditd -> ../init.d/auditd

lrwxrwxrwx   1 root root   14 Jan  2 20:27 K87ipmi -> ../init.d/ipmi

lrwxrwxrwx   1 root root   18 Jan  2 19:17 K89netplugd -> ../init.d/netplugd

lrwxrwxrwx   1 root root   19 Jan  2 19:20 K90bluetooth -> ../init.d/bluetooth

lrwxrwxrwx   1 root root   18 Jan  2 19:20 K94diskdump -> ../init.d/diskdump

lrwxrwxrwx   1 root root   23 Jan  2 19:21 S00microcode_ctl -> ../init.d/microcode_ctl

lrwxrwxrwx   1 root root   25 Jan  2 19:21 S04readahead_early -> ../init.d/readahead_early

lrwxrwxrwx   1 root root   15 Jan  2 19:18 S05kudzu -> ../init.d/kudzu

lrwxrwxrwx   1 root root   17 Jan  2 19:20 S05openibd -> ../init.d/openibd

lrwxrwxrwx   1 root root   18 Jan  2 19:21 S06cpuspeed -> ../init.d/cpuspeed

lrwxrwxrwx   1 root root   18 Jan  2 19:21 S08iptables -> ../init.d/iptables

lrwxrwxrwx   1 root root   14 Jan  2 19:21 S09isdn -> ../init.d/isdn

K表示kill,S表示Start表示對應啟動級别時時候執行和不執行的

數字表示執行的先後詞語,數字越小的越先執行先執行K後執行S。

五:服務控制

ntsysv直接執行的話隻設定目前runlevel,如果想在其他runlevel設定的話需要輸入參數ntsysv --level 35

chkconfig 服務名稱 --level runlevel on|off就完成了

service 服務名稱 start|restart|stop

繼續閱讀