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

AlmaLinux9.2 ; Various 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

③Switching to [enforcing] mode

# setenforce 1
# getenforce
Enforcing

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.Modernize the system

Package updates are performed as soon as possible immediately after OS installation.
However, when a dnf update is performed, a kernel update is also performed at the same time.
Performing a kernel update may require rebooting the system or stopping services, or worse, a kernel panic may occur and the system may not boot. It is wiser to exclude the kernel from the update.
By running dnf -y update with "--exclude=kernel*" behind it
kernel can be excluded from the update target.

# dnf -y update --exclude=kernel*

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 Add 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 Settings(Set on command line)

5.1 Check network device name

# nmcli dev s
DEVICE  TYPE      STATE                   CONNECTION
ens160  ethernet  connected               ens160
lo      loopback  connected (externally)  lo

The network device name can be found as "ens160"

5.2 Host Name Change

Change the host name to Alma to try it out

5.3 Static IPv4 address configuration

The name of the network interface is "ens160" from 5.1
In Almalinux8, this could be done by rewriting the ifcfg-xxx file in network-scripts, but in Almalinux9
However, in Almalinux9, the contents of the /etc/sysconfig/network-scripts/ directory are empty and this method cannot be used, so use the "nmcli" command to change it.
Change the static IPv4 address to "192.168.11.83".

①Change by "nmcli" command

➁Network Settings(Set by GUI)

If the default setting is to obtain an IP address via DHCP during OS installation, change the network settings to a fixed IP address if necessary.
In this case, the network interface is named "ens160". Change the static IPv4 address to "192.168.11.83".

Change the address of the IPv4 configuration

5.4 Host Name Change

Change the host name to Lepard

6.Vim Settings

①Install Vim

# dnf -y install vim-enhanced

②Apply and reflect Vim

③Configure Vim as a user-specific environment

Copied title and URL