Skip to content

Instantly share code, notes, and snippets.

@OndrejValenta
Last active February 19, 2024 19:26
Show Gist options
  • Save OndrejValenta/1a87ead91c413f2ceb25d04f19e32291 to your computer and use it in GitHub Desktop.
Save OndrejValenta/1a87ead91c413f2ceb25d04f19e32291 to your computer and use it in GitHub Desktop.
First steps after clean minimal Rocky Linux 9.2 install
#!/bin/bash
# Update everything automatically
dnf update -y
# Install nano and other useful stuff because you are not a masochist
dnf install epel-release -y;
dnf makecache
dnf install util-linux-user -y;
dnf install nano -y;
dnf install mc -y;
dnf install htop -y;
# Install and start firewalld
dnf install firewalld -y;
systemctl start firewalld.service;
systemctl enable firewalld.service;
firewall-cmd --get-zones;
# Add ip addresses to work zone
firewall-cmd --zone=work --permanent --add-source=[source IP address]
# Clean public zone and move ssh to work zone
firewall-cmd --zone=public --remove-service=cockpit --permanent;
firewall-cmd --zone=public --remove-service=ssh --permanent;
firewall-cmd --reload;
firewall-cmd --zone=work --add-service=ssh --permanent;
firewall-cmd --zone=work --add-service=cockpit --permanent;
# Install cockpit
dnf install cockpit -y;
systemctl enable --now cockpit.socket;
firewall-cmd --reload;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment