啟動的配置文件/etc/inittab,修改完配置文件以后 init q立即生效
# Default runlevel. The runlevels used by RHS are:
# 0 - halt (Do NOT set initdefault to this)
# 1 - Single user mode
# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)
# 3 - Full multiuser mode
# 4 - unused
# 5 - X11
# 6 - reboot (Do NOT set initdefault to this)
一般情況下,0,4,6三種狀態不選擇
id:5:initdefault: #默認的啟動level是5,圖形化操作界面
?
[root@localhost ~]# init 5 #改變當前的級別
[root@localhost ~]# runlevel
3 5 #當前級別
?/etc/rc.d/目錄下面是系統運行的幾個級別 進入每個級別可看到相應的服務【注:K開頭是關閉 S開頭是開啟】
【注:啟動流程】
1 /etc/inittab
2 /etc/rc.d/下面的文件【rc.sysinit系統啟動配置文件,rc[0-6].d6個啟動級別,rc.local用戶需要的啟動項配置】
3 /etc/init.d/下面的都是系統的服務【獨立的服務】 /etc/xinetd.d/下面都是臨時服務
【注:查看一個服務是系統服務還是臨時服務的方法】
[root@localhost ~]# chkconfig --list anacron #chkconfig --list 服務名 如果出現0-6的啟動級別的狀態,則代表是系統服務 anacron 0:關閉 1:關閉 2:啟用 3:啟用 4:啟用 5:啟用 6:關閉
?
【安裝telnet服務 實驗】
1.查詢rpm包是否存在telnet
[root@localhost Server]# ll |grep telnet -r--r--r-- 98 root root 61183 2012-06-15 telnet-0.17-41.el5.x86_64.rpm -r--r--r-- 98 root root 37195 2012-06-15 telnet-server-0.17-41.el5.x86_64.rpm
2.安裝telnet
[root@localhost Server]# rpm -vhi telnet-server-0.17-41.el5.x86_64.rpm
?3.查看telnet-server屬于臨時服務還是系統服務
[root@localhost ~]# rpm -ql telnet-server |grep xinetd /etc/xinetd.d/telnet
4.改變telnet啟動狀態
[root@localhost ~]# chkconfig telnet on
5.查看telnet的配置狀態
[root@localhost ~]# cat /etc/xinetd.d/telnet # default: on # description: The telnet server serves telnet sessions; it uses \ # unencrypted username/password pairs for authentication. service telnet {disable = no #默認的是yes,是否啟動flags = REUSEsocket_type = streamwait = nouser = rootserver = /usr/sbin/in.telnetdlog_on_failure += USERID }
6.查看telnet的端口是否被監聽
[root@localhost ~]# netstat -ln |grep 23 tcp 0 0 0.0.0.0:23 0.0.0.0:* LISTEN
7.創建帳號,并測試登錄
[root@localhost ~]# useradd yimiao [root@localhost ~]# passwd --stdin yimiao Changing password for user yimiao. 123456 passwd: all authentication tokens updated successfully. [root@localhost ~]# [root@localhost ~]# telnet localhost Trying 127.0.0.1... Connected to localhost.localdomain (127.0.0.1). Escape character is '^]'. Red Hat Enterprise Linux Server release 5.9 (Tikanga) Kernel 2.6.18-348.el5 on an x86_64 login: yimiao Password: [yimiao@localhost ~]$ #yimiao已經登錄了
?