Install molly guard and add a file to sudoers.d.

This commit is contained in:
Cyteen May 2020-02-19 18:06:14 +00:00
parent fdb8c6c693
commit 8781856329
1 changed files with 9 additions and 0 deletions

9
020_molly-guard.sh Normal file
View File

@ -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