CentOS设置服务开机自动启动

来源:互联网 发布:淘宝女装进货攻略 编辑:程序博客网 时间:2024/05/02 01:10

如果要查询当前所有自动启动的服务,可以输入:

chkconfig –list

但是这样显示东西太多了,看起来很晕。如果只想看指定的服务怎么办呢?这个时候只需要在“–list”之后加上服务名就好了,比如查看sshd服务是否为自动启动,就输入:

chkconfig –list sshd

这个时候输出的结果:

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

此时0~6均为off,则说明httpd服务不会在系统启动的时候自动启动。我们输入chkconfig sshd on后,再次检查输出结果变为:

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

这个时候2~5都是on,就表明会自动启动了。

此时设置root用户ssh登录密码:

[root@localhost ~]# passwdChanging password for user root.New password: BAD PASSWORD: it is too shortBAD PASSWORD: is too simpleRetype new password: passwd: all authentication tokens updated successfully.[root@localhost ~]# 



0 0
原创粉丝点击