Description: It mainly records the installation, use and basic settings of CentOS8, as well as the new feature configuration practice of the release version;
Installation Environment:
The installation process of CentOS 8.0 is as follows:
WeiyiGeek.Step1
WeiyiGeek.Step2
Server with GUI
, Server
, Minimal installation
);WeiyiGeek.Step3
WeiyiGeek.Step4
Description: Since CentOS8 has abandoned network.service to manage the network, and uses nmcli for the network, this section simply records how to use nmcli for OS8 network configuration;
Manual network configuration file:
sed -i 's/ONBOOT=no/ONBOOT=yes/g'/etc/sysconfig/network-scripts/ifcfg-ens192
sed -i 's/BOOTPROTO=dhcp/BOOTPROTO=static/g'/etc/sysconfig/network-scripts/ifcfg-ens192
sed -i 's/BOOTPROTO=\"dhcp\"/BOOTPROTO=\"static\"/g'/etc/sysconfig/network-scripts/ifcfg-ens192
cat >>/etc/sysconfig/network-scripts/ifcfg-ens192 <<EOF
IPADDR=10.20.172.241
NETMASK=255.255.255.0
GATEWAY=10.20.172..1
EOF
nmcli connect delete'Wired connection 1'&& nmcli disconnect ens192 && nmcli connect ens192 && nmcli c load /etc/sysconfig/network-scripts/ifcfg-ens192
nmcli connect delete'Wired connection 1'
nmcli connect add type ethernet con-name ens192 ifname ens192 ipv4.method manual
nmcli conn add type ethernet con-name eth0 ifname ens192 ipv4.addr 100.20.172.242/24 ipv4.gateway 100.20.172.1 ipv4.dns '223.6.6.6,223.5.5.5' ipv4.method manual
nmcli conn up eth0
Supplementary note:
nmtui command
to manage the graphical interface and set the network card;The ntp software package is no longer supported by default in CentOS8.0, and time synchronization will be implemented by chrony, so the following methods can be used to achieve time synchronization
Continue to use it, but additional installation is required
Time time zone:
# Way 1
cp /etc/localtime{,.bak}
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
# Way 2
timedatectl
timedatectl list-timezones
timedatectl set-timezone Asia/Shanghai
chrony service time synchronization
systemctl restart chronyd
ntp service time synchronization
# The ntp service will be installed from the source provided by wlnmp
# Add wlnmp source-Time synchronization-Time synchronization
rpm -ivh http://mirrors.wlnmp.com/centos/wlnmp-release-centos.noarch.rpm && yum install wntp && ntpdate ntp1.aliyun.com
# You can also write timed tasks to achieve ntp1 every 3 minutes.aliyun.com synchronizes the time once and sets the system time as hardware time
crontab -l && systemctl enable crond.service
$crontab -e
* /3****/usr/sbin/ntpdate ntp1.aliyun.com &>/dev/null;/usr/sbin/hwclock -w
ro
after cl-root to rw init=/sysroot/bin/bash
Hold down the Ctrl and x keys at the same time, the system enters emergency (emergency) mode.
Run the command "chroot /sysroot/" to switch back to the original system and then change the password. After changing the password, run the command touch /.autorelabel
to make the SELinux effective password effective.
/# chroot /sysroot//# LANG=en (change language to English)
/# passwd
/# touch /.autorelabel
Problem description: Check the system time and find that the system time and the Universal time
time differ by 8 hours;
$date
Thu May 1421:13:32 UTC 2020
$timedatectl
Local time:One 2020-05-1421:13:19 CST
Universal time:One 2020-05-1413:13:19 UTC #Actual time
RTC time:One 2020-05-1413:13:19
Time zone: Asia/Shanghai(CST,+0800)
NTP enabled: no
NTP synchronized: no
RTC in local TZ: no
DST active: n/a
Solution:
#1. View the system time zone and delete the partition where the current system is located
ls /usr/share/zoneinfo/
sudo rm /etc/localtime
#2. From/usr/share/zoneinfo/Create a soft link in to replace the current time zone information, and directly select Universal:
sudo ln -s /usr/share/zoneinfo/Universal /etc/localtime
#3. Check the system time again and return to normal
Recommended Posts