Skip to content

Instantly share code, notes, and snippets.

@OndrejValenta
Last active July 19, 2020 22:24
Show Gist options
  • Save OndrejValenta/3ca6ac4ef2e09e121a2d7e541174a479 to your computer and use it in GitHub Desktop.
Save OndrejValenta/3ca6ac4ef2e09e121a2d7e541174a479 to your computer and use it in GitHub Desktop.
Hetzner Centos 8 - first steps
# Update everything automatically
yum update -y
# Install nano and other useful stuff because you are not a masochist
yum install epel-release -y;
yum install nano -y;
yum install mc -y;
yum install htop -y;
# Install and start firewalld
yum 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
yum 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