From 878185632984743d9f08fd31531b9fdfd7efe284 Mon Sep 17 00:00:00 2001 From: Cyteen May Date: Wed, 19 Feb 2020 18:06:14 +0000 Subject: [PATCH] Install molly guard and add a file to sudoers.d. --- 020_molly-guard.sh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 020_molly-guard.sh diff --git a/020_molly-guard.sh b/020_molly-guard.sh new file mode 100644 index 0000000..2d02907 --- /dev/null +++ b/020_molly-guard.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +# Molly-Guard try to block you from accidentally running or shutting down or rebooting Linux servers via ssh. +apt-get install -y molly-guard + +# sudo and tmux stop detection of the SSH session. (It also affects screen the same way - this is a known issue listed in man molly-guard.) +cat > /etc/sudoers.d/molly-guard << EOF +Defaults env_keep += SSH_CONNECTION +EOF