SELinux, run level init, firewall iptables

Source: Internet
Author: User


SElinux is the implementation of the U.S. National Security Agency's enforcement of access control.


Modify the configuration file to disable SELinux for permanent effect: (restart Effective)

[Email protected] ~]# Cat/etc/selinux/config


# This file controls the state of the 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=enforcing

# selinuxtype= can take one of these the values:

# targeted-targeted processes is protected,

# Mls-multi level Security protection.

selinuxtype=targeted


[Email protected] ~]# sed-i "S#selinux=enforcing#selinux=disabled#g"/etc/selinux/config

[Email protected] ~]# Cat/etc/selinux/config


# This file controls the state of the 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 the values:

# targeted-targeted processes is protected,

# Mls-multi level Security protection.

selinuxtype=targeted



[[email protected] ~]# grep =disabled/etc/selinux/config

Selinux=disabled


Temporary entry into force:

[Email protected] ~]# Getenforce

Enforcing

[Email protected] ~]# Setenforce

Usage:setenforce [Enforcing | Permissive | 1 | 0]

[Email protected] ~]# Setenforce 0

[Email protected] ~]# Getenforce

Permissive

Getenforce Checking selinux status

Setenforce setting SELinux Status 1 Enable 0 warning, do not enable


In order for the restart or not restart to take effect, both of the above methods have to be modified



Operating level:

There are 7 levels of operation, looking at various levels:

[Email protected] ~]# Tail/etc/inittab

# Default RunLevel. The runlevels used is:

# 0-halt (do not set Initdefault to this)

# 1-single User mode--single user

# 2-multiuser, without NFS (the same as 3, if you don't have networking)

# 3-full Multiuser Mode--Fully multi-user

# 4-unused

# 5-x11--Switch to desktop environment, need to install desktop package

# 6-reboot (do not set Initdefault to this)

#

Id:3:initdefault:

To view the run level:

[Email protected] ~]# RunLevel

N 3

To switch the run level:

[[Email protected] ~]# init 6---> (restart)


How to turn off the Linux firewall:

/etc/init.d/iptables stop==service iptables stop is best performed two times in succession

Or:

[Email protected] ~]# chkconfig iptables off

To view the firewall:

[Email protected] ~]# iptables-l-N




SELinux, run level init, firewall iptables

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.