2013年3月7日 星期四 晴



chkconfig




一、注册与反注册



[root@desktop7 ~]# chkconfig --list sshd


sshd            0:off   1:off   2:on    3:on    4:on    5:on    6:off


[root@desktop7 ~]#



[root@desktop7 ~]# chkconfig --del sshd


[root@desktop7 ~]# chkconfig --list sshd


service sshd supports chkconfig, but is not referenced in any runlevel (run 'chkconfig --add sshd')



[root@desktop7 ~]# chkconfig --add sshd


[root@desktop7 ~]# chkconfig --list sshd


sshd            0:off   1:off   2:on    3:on    4:on    5:on    6:off


[root@desktop7 ~]#




二、配置SSHD服务



[root@desktop7 ~]# chkconfig --list sshd


sshd            0:off   1:off   2:on    3:on    4:on    5:on    6:off



[root@desktop7 ~]# chkconfig --level 2 sshd off


[root@desktop7 ~]# chkconfig --list sshd


sshd            0:off   1:off   2:off   3:on    4:on    5:on    6:off


[root@desktop7 ~]# chkconfig sshd on



[root@desktop7 ~]# chkconfig --list sshd


sshd            0:off   1:off   2:on    3:on    4:on    5:on    6:off


[root@desktop7 ~]#



三、管理启动文件



1、查看服务状态



[root@desktop7 ~]# cat /etc/xinetd.d/gssftp


# default: off


# description: The kerberized FTP server accepts FTP connections \


#              that can be authenticated with Kerberos 5.


service ftp


{


        flags           = REUSE


        socket_type     = stream        


        wait            = no


        user            = root


        server          = /usr/kerberos/sbin/ftpd


        server_args     = -l -a


        log_on_failure  += USERID


        disable         = yes


}



(默认为off)



2、查询启动状态



[root@desktop7 ~]# chkconfig --list gssftp


gssftp          off



3、开启服务



[root@desktop7 ~]# chkconfig gssftp on



4、查看文件内容



[root@desktop7 ~]# cat /etc/xinetd.d/gssftp


# default: off


# description: The kerberized FTP server accepts FTP connections \


#              that can be authenticated with Kerberos 5.


service ftp


{


        disable = no


        flags           = REUSE


        socket_type     = stream        


        wait            = no


        user            = root


        server          = /usr/kerberos/sbin/ftpd


        server_args     = -l -a


        log_on_failure  += USERID


}




(改变情况disable=no)