aboutsummaryrefslogtreecommitdiffstats
path: root/openbsd-image/scripts/harden-root.sh
diff options
context:
space:
mode:
Diffstat (limited to 'openbsd-image/scripts/harden-root.sh')
-rwxr-xr-xopenbsd-image/scripts/harden-root.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/openbsd-image/scripts/harden-root.sh b/openbsd-image/scripts/harden-root.sh
new file mode 100755
index 0000000..c8e267a
--- /dev/null
+++ b/openbsd-image/scripts/harden-root.sh
@@ -0,0 +1,12 @@
+#!/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 "$@"