見出し画像

CentOS-8.2.2004(minimal)の初期設定

CentOS-8.2.2004(minimal)の構築後に行うことを想定しています。
行頭に#がついているものはrootユーザーで実行してください。
行頭に$がついているものは一般ユーザーで実行してください。

CentOSバージョン確認

# cat /etc/redhat-release

画像1

手動アップデート

# dnf -y update

自動アップデート

# dnf -y install dnf-automatic
# vi /etc/dnf/automatic.conf
-----
18 apply_updates = yes
-----
# systemctl enable dnf-automatic.timer
# systemctl start dnf-automatic.timer
# systemctl status dnf-automatic.timer

画像2

【Active: active】と出力されていればOKです。

ファイル検索(利便性向上)

# dnf -y install mlocate
# updatedb
# locate sshd_config

画像3

【/etc/ssh/sshd_config】と【/usr/share/man/man5/sshd_config.5.gz】が見つかりました。

systemctl のタブ補完(利便性向上)

# dnf -y install bash-completion

時刻合わせ(chrony)

# dnf -y install chrony
# vi /etc/chrony.conf
-----
 3 # pool 2.centos.pool.ntp.org iburst
 4 pool ntp.toho-u.ac.jp iburst
 5 pool ntp.nict.jp iburst
 6 pool ntp.jst.mfeed.ad.jp iburst
 7 pool time.google.com iburst
-----
3行目をコメントアウトして、4-7行目を追加
# systemctl enable chronyd.service
# systemctl start chronyd.service
# systemctl restart chronyd.service
# chronyc sources

画像4

上記の場合【ntp-a2.nict.go.jp】が同期中のサーバーになります。

SELinuxの状態確認

# getenforce
-----
Enforcing  有効
Permissive 無効(ログあり)
Disable   無効(ログ無し)
-----

SELinuxを一時的に無効にする

# setenforce 0

SELinuxを恒久的に無効にする

vi /etc/selinux/config
-----
 7 SELINUX=disabled
-----

おまじないの再起動

# reboot



この記事が気に入ったらサポートをしてみませんか?