業務用エアコン関連の技術情報、エラーコード、環境問題対策に関する別サイト「エアコンの安全な修理・適切なフロン回収」

CentOS Stream9 : Initial settings after installation

1.Disabling SELinux

First, disable selinux. selinux is a feature that improves auditing and security in Linux, but when enabled, it places considerable restrictions on the behavior of services and on what can be configured. Therefore, it is basically disabled in many cases.
SELinux Operation Mode
Enforcing : SELinux functionality is enabled and access control is enabled
Permissive : SElinux will warn, but no access restrictions will be placed
disabled : Both SElinux function and access control are disabled

①Current SELinux status

# getenforce
Enforcing

②Switching to [permissive] mode

# setenforce 0
# getenforce
Permissive

To completely disable SELinux, a reboot is required by adding selinux=0 to the kernel command line as follows

# grubby --update-kernel ALL --args selinux=0
# reboot

※ To return SELinux to active, do the following (reboot after changes)

# grubby --update-kernel ALL --remove-args selinux
# reboot

2.System Modernization

Update packages as soon as possible after OS installation.

# dnf -y update

3.Services to be stopped due to security measures

# systemctl stop atd.service
# systemctl disable atd.service
# systemctl stop kdump.service
# systemctl disable kdump.service
# systemctl stop lvm2-monitor.service
# systemctl disable lvm2-monitor.service
# systemctl stop mdmonitor.service
# systemctl disable mdmonitor.service
# systemctl stop smartd.service
# systemctl disable smartd.service
# systemctl stop dm-event.socket
# systemctl disable dm-event.socket

4.Adding Repositories

4.1 Add EPEL repository

# dnf config-manager --set-enabled crb
# dnf -y install epel-release
# vi /etc/yum.repos.d/epel.repo

4.2 Added Remi's RPM repository

# dnf -y install https://rpms.remirepo.net/enterprise/remi-release-9.rpm
# dnf -y config-manager --set-enabled remi
# vi /etc/yum.repos.d/remi-safe.repo

5.Network configuration (command line configuration)

5.1 Check network device name

# nmcli dev s
DEVICE  TYPE      STATE      CONNECTION
ens160  ethernet  connected  ens160
lo      loopback  unmanaged  --

Network device name is "ens160".

5.2 Host Name Change

Change the host name to Lepard

# hostnamectl set-hostname Lepard

Log in again
[huong@Lepard:~]$

5.3 Static IPv4 address configuration

The name of the network interface is "ens160" from 5.1
On CentOS8, it could be changed by rewriting the ifcfg-xxx file found in network-scripts, but on CentOS9, it can be changed with the "nmcli" command.
Change the static IPv4 address to "192.168.11.83".


①Change by "nmcli" command

# Fixed IPv4 address setting
# nmcli connection modify ens160 ipv4.addresses 192.168.11.83/24

# Gateway Configuration
# nmcli connection modify ens160 ipv4.gateway 192.168.11.1

# Referenced DNS settings
# nmcli connection modify ens160 ipv4.dns 192.168.11.1

# DNS Search Base Settings (own domain name)
# nmcli connection modify ens160 ipv4.dns-search cent.korodes.com

# Set to fixed IP address assignment
# nmcli connection modify ens160 ipv4.method manual

# Reboot interface to reflect settings
# nmcli connection down ens160; nmcli connection up ens160
Connection 'ens160' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/1)
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/2)

➁Change in GUI

Change the fixed IPv4 address to "192.168.11.83" as above.

Change the address of the IPv4 configuration

5.4 Host Name Change

Change the host name to Lepard

6.Vim Settings

①Installing Vim

# dnf -y install vim-enhanced

②Apply and reflect Vim

# vi ~/.bashrc
# Alias appended to the last line
alias vi='vim'
# source ~/.bashrc

③Configure Vim as a user-specific environment

# vi ~/.vimrc

Copied title and URL