almalinux8 setup log


# date
sudo date MMDDhhmm
timedatectl
timedatectl list-timezones
timedatectl set-timezone Asia/Tokyo

# selinux
sudo vi /etc/selinux/config
sudo reboot

#
sudo groupadd -g xxx xxx
sudo useradd -u xxx -g xxx -G wheel -c 'xxx' xxx
sudo passwd xxx

# nw
cd /etc/sysconfig/network-scripts
sudo mkdir OLD
cp -p ifcfg-ens192 OLD/ifcfg-ens192.202106040
sudo nmcli d show ens192
sudo nmcli c mod ens192 connection.autoconnect yes
sudo nmcli c mod ens192 ipv4.addresses xxx.xxx.xxx.xxx/xx
sudo nmcli c mod ens192 ipv4.gateway xxx.xxx.xxx.xxx
sudo nmcli c mod ens192 ipv6.method ignore
sudo nmcli c mod ens192 ipv4.dns xxx.xxx.xxx.xxx
sudo nmcli c mod ens192 ipv4.dns xxx.xxx.xxx.xxx
sudo nmcli c mod ens192 ipv4.method manual
sudo nmcli c down ens192; sudo nmcli c up ens192

# hostname
sudo vi /etc/hostname
sudo reboot

# yum
sudo yum -y update
sudo yum -y install open-vm-tools
sudo yum -y install gcc
sudo yum -y install make
sudo yum -y install sysstat
sudo yum -y install net-tools
sudo yum -y install python3
sudo yum -y install emacs
sudo yum -y install lsof
sudo yum -y install strace
sudo yum -y install nmap-ncat
sudo yum -y install tcpdump
sudo yum -y install binutils
sudo yum -y install epel-release
sudo yum -y install screen
sudo yum -y install perl

# rsyslog
sudo yum -y install rsyslog

# sudoers
cd /etc/
sudo cp -p sudoers OLD/sudoers.2021060501
sudo visudo
sudo diff OLD/sudoers.2021060501 sudoers
=====
88c88
< Defaults    secure_path = /sbin:/bin:/usr/sbin:/usr/bin
---
> Defaults    secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
=====

# rsyslog
cd /etc/
sudo b rsyslog.conf
sudo vi rsyslog.conf
--- diff rsyslog.conf OLD/rsyslog.conf.2021062001 ---
28,30d27
< $umask 0000
< $DirCreateMode 0755
< $FileCreateMode 0644
---
sudo systemctl restart rsyslog

# logrotate
cd /etc/
sudo b logrotate.conf
sudo vi logrotate.conf
=====
6c6
< rotate 4
---
> rotate 12
9c9
< create
---
> create 0644 root root
15c15
< #compress
---
> compress
=====

# sysstat
cd /usr/lib/systemd/system
sudo b sysstat-collect.timer
sudo b sysstat-collect.service
sudo systemctl edit sysstat-collect.timer
# /etc/systemd/system/sysstat-collect.timer.d/override.conf
---
[Unit]
Description=Run system activity accounting tool every 1 minutes

[Timer]
OnCalendar=*:00/1

[Install]
WantedBy=sysstat.service
---

sudo yum install clamav
sudo yum install clamav-update
sudo freshclam