diff options
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/harden-root.sh | 12 | ||||
| -rwxr-xr-x | scripts/setup.sh | 32 |
2 files changed, 0 insertions, 44 deletions
diff --git a/scripts/harden-root.sh b/scripts/harden-root.sh deleted file mode 100755 index c8e267a..0000000 --- a/scripts/harden-root.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -set -e - -main() { - chown root:wheel /etc/doas.conf - chmod 0640 /etc/doas.conf - usermod -p '*' root - sed -i 's/^PermitRootLogin.*/PermitRootLogin no/' /etc/ssh/sshd_config - rcctl reload sshd -} - -main "$@" diff --git a/scripts/setup.sh b/scripts/setup.sh deleted file mode 100755 index 320d93d..0000000 --- a/scripts/setup.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -set -e - -: "${ADMIN_USER:?ADMIN_USER must be set}" - -main() { - update_pkgs - install_system_maintenance_cron_jobs "$ADMIN_USER" - allow_user_non_root_shutdown "$ADMIN_USER" -} - -update_pkgs() { - # Ensure the time is in sync. If it is not, things like upgrading the system - # packages via pkg_add -u fail. - rdate -n pool.ntp.org - pkg_add -u - fw_update -} - -install_system_maintenance_cron_jobs() { - ( - echo "MAILTO=$1" # Send mail about root cron jobs to the admin user. - crontab -l 2>/dev/null # Print existing cron file; redirect stderr if empty cron file error. - echo "10 12 * * * /usr/sbin/syspatch -c" # Install any outstanding patches everyday at 12:10 - ) | crontab - -} - -allow_user_non_root_shutdown() { - usermod -G _shutdown "$1" -} - -main "$@" |