Initial configuration of Linux systems (including network, hostname, shutdown FIREWALLD and SELinux)

Source: Internet
Author: User

Each time we use Linux, we will initialize the system configuration, listed below.

1. Opening of the service

Systemctl Enable Firewalld.service            // set the specified service to boot systemctl disable Firewalld.service           //  systemctl is-enabled firewalld.service        // query is set to start automatically

2. Temporarily open, close, and restart the service.

Systemctl start Filewalld.service        // temporarily turn on the Firewall service systemctl stop Filewalld.service           temporarily stop Firewall service systemctl restart Filewalld.service      // Restart Firewall service

3. Modify the temporary and permanent host name

hostname + hostname                       // temporary hostnamectl  set-hostname + host name      // will not change after rebooting the system
Vi/etc/hostname //can also enter to modify the configuration host name

4. Network Configuration

IP address Add +IP address + subnet mask  dev nic name              // temporary effective nic file vi  /etc/sysconfig/ network-scripts/ifcfg-NIC name         // Configure permanent NIC configuration file

Configuration of 5.selinux

Vi/etc/sysconfig/selinux/Enter SELinux to modify file, add selinux=disable to deactivate SELinux function in last line

Disabled: Disable SELinux function permissive  : Displays only warning messages and does not block
Enforcing : Enforces SELinux functionality to generate warning messages

Initial configuration of Linux systems (including network, hostname, shutdown FIREWALLD and SELinux)

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.