初识Linux,简单配置

对于初学者来讲,操作系统安装完成之后最好先关闭防火墙和selinux,今天我就简单带大家配置一下

  • systemd的各种单元类型
    初识Linux,简单配置
    sysvinit运行级别
    初识Linux,简单配置
    初识Linux,简单配置
    初识Linux,简单配置
  • 常见的几种控制类型
    start(启动):运行指定的系统服务程序,实现服务功能
    stop(停止):终止指定的系统服务程序,关闭相应的功能
    restart(重启):先退出,再重新运行指定的系统服务程序
    reload(重载):不退出服务程序,只是刷新配置,再某些服务中与restart的操作相同
    status(查看状态):查看指定的系统服务的运行状态及相关信息
    初识Linux,简单配置
  • 查看系统的target
    初识Linux,简单配置
    因为我是图形切换的字符,所以是5 3 使用init 3切换即可
    [root@centos ~]#init 0 //关闭当前系统
    [root@centos ~]#init 6 //重启当前系统
    或者
    [root@centos ~]#systemctl poweroff //关闭当前系统
    [root@centos ~]#systemctl reboot //重启当前系统

  • 使用systemctl工具
    systemctl 控制选项 服务名称
  • 常见的选项如下:
    enable:开机自动启动
    disable:开机自动关闭
    is-enable:查看开机启动状态
    [root@centos ~]#systemctl enable 服务名称
    [root@centos ~]#systemctl disable 服务名称
    [root@centos ~]#systemctl is-enable 服务名称

猜你喜欢

转载自blog.51cto.com/14156658/2401270
今日推荐