Steps updated for Fedora Server 28 64-bit DVD ISO.
- Software selection: Fedora Custom Operating System
- No add-ons checked.
- Network & Host Name: Set Hostname
# If CentOS8:
# sudo dnf config-manager --set-enabled PowerTools && \
# sudo dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm && \
sudo dnf -y install \
bind-utils bzip2 git iftop iotop jq lsof moreutils nmap patch pciutils psmisc pv screen \
tar tcpdump telnet time unzip vim wget traceroute net-tools sysstat \
&& sudo dnf -y update
curl -sSf https://raw.githubusercontent.com/Robpol86/dotfiles/master/vimrc |sudo tee -a /etc/vimrc
curl -sSf https://raw.githubusercontent.com/Robpol86/dotfiles/master/bashrc.sh |sudo tee /etc/profile.d/robpol86.sh
curl -sSf https://raw.githubusercontent.com/Robpol86/dotfiles/master/bash_profile.sh |sudo tee -a /etc/profile.d/robpol86.sh
bash -lc _robpol86_run_once
sudo sed -i 's/ rhgb quiet/ vga=792/g' /etc/default/grub
sudo grub2-mkconfig -o $(sudo find /boot -name grub.cfg)
sudo lvresize -l +100%FREE /dev/fedora*/root && sudo xfs_growfs /
I Generate SSH keys with:
# Run on the client.
ssh-keygen -t ed25519 -a 100 -C "$(date -u +"%Y-%m-%dT%H:%M:%SZ") $HOSTNAME" -f ~/.ssh/REPLACE_ME
Then:
curl -sSf https://gist.githubusercontent.com/Robpol86/6226495/raw/ssh_authenticator.sh |
tee /dev/stderr |install -m0755 /dev/stdin ./ssh_authenticator.sh
./ssh_authenticator.sh
vim ~/.ssh/authorized_keys # Paste public keys.
SparkPost has a very generous free tier and is much easier to setup than Gmail SMTP (with the added benefit of not having to store your Google password in clear text on your Linux host). I use this script to configure Postfix on my Linux hosts so I get emails when crons fail or if there are hardware failures.
curl -sSf https://gist.githubusercontent.com/Robpol86/6226495/raw/postfix_sparkpost.sh |
tee /dev/stderr |install -m0755 /dev/stdin ./postfix_sparkpost.sh
sudo ./postfix_sparkpost.sh
On my non-main Fedora systems I don't mind them installing DNF updates automatically and even rebooting when needed. Below is how I enable this feature and have it run every night at midnight and 10 minutes after boot:
sudo dnf install -y dnf-automatic && \
sudo sed -i '/^\s*apply_updates = /s/=.*$/= yes/' /etc/dnf/automatic.conf
sudo SYSTEMD_EDITOR=tee systemctl edit dnf-automatic.service << 'EOF'
[Service]
ExecStartPost=/bin/sh -c "uname -r |xargs -I+ grep -Fq + /boot/grub2/grubenv || shutdown -r +5 'dnf-automatic new kernel'"
EOF
sudo SYSTEMD_EDITOR=tee systemctl edit dnf-automatic.timer << EOF
[Timer]
OnBootSec=
OnUnitInactiveSec=
OnBootSec=10m
OnCalendar=*-*-* 00:00:00
RandomizedDelaySec=10m
EOF
sudo systemctl enable --now dnf-automatic.timer