启动的配置文件/etc/inittab,修改完配置文件以后 init q立即生效

# Default runlevel. The runlevels used by RHS are:
# - halt (Do NOT set initdefault to this)
# - Single user mode
# - Multiuser, without NFS (The same as , if you do not have networking)
# - Full multiuser mode
# - unused
# - X11
# - reboot (Do NOT set initdefault to this)

一般情况下,0,4,6三种状态不选择

id::initdefault: #默认的启动level是5,图形化操作界面
[root@localhost ~]# init 5 #改变当前的级别
[root@localhost ~]# runlevel
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 :关闭 :关闭 :启用 :启用 :启用 :启用 :关闭

【安装telnet服务 实验】

1.查询rpm包是否存在telnet

[root@localhost Server]# ll |grep telnet
-r--r--r-- root root -- telnet-0.17-.el5.x86_64.rpm
-r--r--r-- root root -- telnet-server-0.17-.el5.x86_64.rpm

2.安装telnet

[root@localhost Server]# rpm -vhi telnet-server-0.17-.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 = REUSE
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.telnetd
log_on_failure += USERID
}

6.查看telnet的端口是否被监听

[root@localhost ~]# netstat -ln |grep
tcp 0.0.0.0: 0.0.0.0:* LISTEN

7.创建帐号,并测试登录

[root@localhost ~]# useradd yimiao
[root@localhost ~]# passwd --stdin yimiao
Changing password for user yimiao. 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.-.el5 on an x86_64
login: yimiao
Password:
[yimiao@localhost ~]$ #yimiao已经登录了
05-28 19:23