虚拟机中最小化安装最新版centos 7后发现没有ifconfig等命令。
cd /etc/sysconfig/network-scripts/vi编辑 第一个ifcfg-ens33
vi ifcfg-ens33
ONBOOT=no改为yes
:wq 保存后重启网卡
service network restart
然后就可以联网了安装ifconfig、service、chkconfig等基础命令
yum groupinstall base
在centos 7 中安装ssh服务
yum install -y openssh-server系统0-6 7个运行级别,2 3 4 运行指向同一个文件
ll /lib/systemd/system/runlevel*.targetsystemctl可以看作是service和chkconfig的组合
job chkconfig、service systemctl
服务开机自启动 chkconfig --level 3 httpd on systemctl enable httpd
服务不开机自启动 chkconfig --level 3 httpd off systemctl disable httpd
服务状态 service httpd status
服务详细信息 systemctl status httpd
只显示是否active systemctl is-active httpd
所有服务的启动状态 chkconfig --list systemctl list-units --type=service
启动服务 service httpd start systemctl start httpd
停止服务 service httpd stop systemctl stop httpd
重启服务 service httpd restart systemctl restart httpd