Skip to content

Instantly share code, notes, and snippets.

@marvin-marvin
Last active January 25, 2021 12:23
Show Gist options
  • Save marvin-marvin/403c1eeb47dfd591176d408a713adf4a to your computer and use it in GitHub Desktop.
Save marvin-marvin/403c1eeb47dfd591176d408a713adf4a to your computer and use it in GitHub Desktop.
photon kubes setup
#Setup Photon OS
# SSH
# replace #PermitRootLogin prohibit-password with PermitRootLogin yes ; systemctl restart sshd
vi .ssh/authorized_keys (insert pub key)
# set hostname
hostnamectl set-hostname NAME
nano /etc/hosts
<reboot>
# DNS
rm /etc/resolv.conf
ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
<wget dns config from crontab>
# Packages
tdnf -y update ; tdnf -y install nano wget rsync git make mc unzip zip cronie tmux
# NTP
timedatectl set-timezone Europe/London
timedatectl set-ntp true
systemctl enable systemd-timesyncd
# disable swap
free -h ; swapoff -a ; nano /etc/fstab ; mount -a
# ping + save rule
iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT
iptables-save > /etc/systemd/scripts/ip4save
# disable password expiration
chage -I -1 -m 0 -M 99999 -E -1 root
# Cron
/usr/bin/wget -q https://gist.githubusercontent.com/marvin-marvin/ba839de656c98fa3eb7ac5685f99327c/raw/crontab.txt -O /tmp/crontab ; /usr/bin/crontab /tmp/crontab
echo "/usr/bin/wget -q https://gist.githubusercontent.com/marvin-marvin/ba839de656c98fa3eb7ac5685f99327c/raw/crontab.txt -O /tmp/crontab ; /usr/bin/crontab /tmp/crontab" >> /etc/rc.d/rc.local #rc.d!!!
<reboot>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment