AlmaLinux Initiale OS-installatiehandleiding

Wat

Dit artikel biedt een praktische en minimale handleiding voor de initiële configuratie van AlmaLinux na een verse installatie, bedoeld voor serveromgevingen.

Waarom

Na installatie vereist AlmaLinux essentiële systeemconfiguratie om veilig, beheersbaar en netwerktoegankelijk te functioneren. Deze stappen vormen een solide basis vóór applicatiedeployment.

Hoe

Stap 1: Hostnaam wijzigen

hostnamectl set-hostname your-hostname
echo "127.0.0.1   localhost your-hostname" >> /etc/hosts

Stap 2: Netwerk configureren (Voorbeeld: Statisch IP-adres)

nmcli con mod "eth0" ipv4.addresses 192.168.1.100/24
nmcli con mod "eth0" ipv4.gateway 192.168.1.1
nmcli con mod "eth0" ipv4.dns 8.8.8.8
nmcli con mod "eth0" ipv4.method manual
nmcli con up "eth0"

Stap 3: Proxy instellen (indien nodig)

cat <<EOF > /etc/profile.d/proxy.sh
export http_proxy="http://proxy.example.com:8080"
export https_proxy="http://proxy.example.com:8080"
export no_proxy="localhost,127.0.0.1"
EOF
chmod +x /etc/profile.d/proxy.sh
source /etc/profile.d/proxy.sh
echo 'proxy=http://proxy.example.com:8080' >> /etc/dnf/dnf.conf

Stap 4: SELinux uitschakelen

sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config
setenforce 0

Stap 5: Systeem updaten

dnf update -y
dnf upgrade -y

Stap 6: Firewall configureren

systemctl enable --now firewalld
firewall-cmd --permanent --add-service=ssh
firewall-cmd --reload

Stap 7: Tijdzone en NTP instellen

timedatectl set-timezone Asia/Tokyo
systemctl enable --now chronyd

Stap 8: Beheerder toevoegen met SSH-sleutel

useradd adminuser
passwd adminuser
usermod -aG wheel adminuser
mkdir -p /home/adminuser/.ssh
chmod 700 /home/adminuser/.ssh
vi /home/adminuser/.ssh/authorized_keys  # Voeg openbare sleutel toe
chmod 600 /home/adminuser/.ssh/authorized_keys
chown -R adminuser:adminuser /home/adminuser/.ssh

Stap 9: Herstarten om SELinux-instellingen toe te passen

reboot

Conclusie

Deze minimale installatie configureert AlmaLinux als een veilige en betrouwbare serverbasis. De handleiding dekt hostnaaminstellingen, netwerk en proxy, updates, essentiële beveiliging, SELinux-uitzetting, firewallbeheer en tijdinstellingen.

タイトルとURLをコピーしました