CentOS basic operation configuration command

Source: Internet
Author: User
1. the basic command package requires the yumgroupinstallbase (on the CD image) after installation, ifconfig, service, chkconfig, and other commands will all have 2. before modifying Redhat7 at the run level, modify the/etc/inittab file. If Redhat7 is used, a prompt will be displayed when you view the file. 1. basic command package

First, yum groupinstall base (on the CD image) is required)

After installation, ifconfig, service, chkconfig, and other commands will all be available.

2. run-level modification

Before Redhat 7, modify the/etc/inittab file.

If Redhat 7 is used, a prompt is displayed when you view the file.

# Inittab is no longer used when using1_emd.
#
# Adding configuration here will have no effect onyour system.
#
# Ctrl-Alt-Delete is handled by/etc/systemd/system/ctrl-alt-del.target
#
# Define EMD uses 'targets' instead of runlevels. Bydefault, there are two main targets:
#
# Multi-user.target: analogous to runlevel 3
# Graphical.tar get: analogous to runlevel 5
#
# To set a default target, run:
#
# Ln-sf/lib/systemd/system/ . Target/etc/systemd/system/default.tar get

You only need to create a software connection under the/lib/system/directory.

 

3. network configuration a) network manager

RHEL 7 has a network manager installed and is in the startup status.

# Systemctl status NetworkManager. service

B) view network interfaces

# Nmcli dev status

View network interfaces.

C) text configuration network

Add files such as ifcfg-enp0s3 in the following path

#/Etc/sysconfig/network-scripts/

 

D) configure the network in a graphical manner

# Nmtui

Start graphical configuration.

E) start the network

# Systemctl restart network. service

4. host name

Edit File

/Etc/hostname

You can modify the host name.

Note: Before RedHat7, edit the/etc/sysconfig/network file.

Run the hostnamectlstatus command in Redhat7 to view the host name.

# Hostnamectl status

You can also

# Nmtui

Host Name

5. firewall

View the firewall status.

# Systemctl status firewalld

Temporarily disable the firewall command. After the computer is restarted, the firewall automatically starts up.

Systemctl stop firewalld

Permanently disable firewall commands. The firewall will not start automatically after it is restarted.

Systemctl disable firewalld

Open the firewall command.

Systemctl enable firewalld

Related Article

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.