• CentOS修改默认运行级别,禁用SeLinux


    [1] 修改默认运行级别,默认只启用命令行界面,可以节省资源

    如下,修改inittab文件中的默认启动级别,由5改至3。(注意:默认运行级别不要设置为0或6

    各启动级别含义如下:

    0 停机,机器关闭。
    1 单用户模式,就像Win9x下的安全模式类似。
    2 多用户模式,但是没有NFS支持。
    3 完整的多用户模式,是标准的运行级。
    4 预留,未使用
    5 就是X11,进到X Window系统了。
    6 为重启,运行init 6机器就会重启。

    [root@localhost ~]# vim /etc/inittab
    # inittab is only used by upstart for the default runlevel.
    #
    # ADDING OTHER CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.
    #
    # System initialization is started by /etc/init/rcS.conf
    #
    # Individual runlevels are started by /etc/init/rc.conf
    #
    # Ctrl-Alt-Delete is handled by /etc/init/control-alt-delete.conf
    #
    # Terminal gettys are handled by /etc/init/tty.conf and /etc/init/serial.conf,
    # with configuration in /etc/sysconfig/init.
    #
    # For information on how to write upstart event handlers, or how
    # upstart works, see init(5), init(8), and initctl(8).
    #
    # Default runlevel. The runlevels used 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)
    #
    id:3:initdefault:

    [2] 禁用SELinux

    [root@localhost ~]# vi /etc/sysconfig/selinux
    
    # This file controls the state of SELinux on the system.
    # SELINUX= can take one of these three values:
    #     enforcing - SELinux security policy is enforced.
    #     permissive - SELinux prints warnings instead of enforcing.
    #     disabled - No SELinux policy is loaded.
    SELINUX=disabled
    # SELINUXTYPE= can take one of these two values:
    #     targeted - Targeted processes are protected,
    #     mls - Multi Level Security protection.
    SELINUXTYPE=targeted

    修改后重启Linux或使用setenforce 0命令实时禁用SELinux

  • 相关阅读:
    alpha版、beta版、rc版的意思
    回车符(CR)与换行符(LF), ' '和' '的区别
    html 图像映射(一个图像多个连接)
    前端工程师需要明白的「像素」
    通过设置Ionic-Cli代理解决ionic serve跨域调试问题
    Bootstrap Table使用方法详解
    写给移动开发者的 React Native 指南
    Mac中搭建 iOS 的 React Native 环境
    Windows版本搭建安装React Native环境配置及相关问题
    javascript获取wx.config内部字段解决微信分享
  • 原文地址:https://www.cnblogs.com/lightnear/p/2713090.html
Copyright © 2020-2023  润新知