• Linux的进程与服务(一)


    启动的配置文件/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           = REUSE
            socket_type     = stream
            wait            = no
            user            = root
            server          = /usr/sbin/in.telnetd
            log_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已经登录了
  • 相关阅读:
    Ibatis中SqlMapClientTemplate和SqlMapClient的区别
    Spring整合Ibatis之SqlMapClientDaoSupport
    iBatis查询时报"列名无效"或"找不到栏位名称"无列名的错误原因及解决方法
    五个程序员求职者的最佳提问
    JVM性能调优指南
    Review software requirements specification and create test scenarios (what to test for a certain functionality)
    Security Testing Test Scenarios
    Performance testing test scenarios
    Test Scenarios for Excel Export functionality
    Test Scenarios for sending emails
  • 原文地址:https://www.cnblogs.com/yimiao/p/3903056.html
Copyright © 2020-2023  润新知