Ensure privilege separation exists

This commit is contained in:
Bob Mottram 2017-06-29 13:47:22 +01:00
parent 9ffb2b235f
commit 28381df8f5
1 changed files with 3 additions and 0 deletions

View File

@ -115,6 +115,9 @@ function configure_ssh {
echo "KexAlgorithms $SSH_KEX" >> /etc/ssh/sshd_config echo "KexAlgorithms $SSH_KEX" >> /etc/ssh/sshd_config
fi fi
sed -i "s|#KexAlgorithms $SSH_KEX|KexAlgorithms $SSH_KEX|g" /etc/ssh/sshd_config sed -i "s|#KexAlgorithms $SSH_KEX|KexAlgorithms $SSH_KEX|g" /etc/ssh/sshd_config
if ! grep -q 'UsePrivilegeSeparation' /etc/ssh/sshd_config; then
echo 'UsePrivilegeSeparation sandbox' >> /etc/ssh/sshd_config
fi
sed -i 's|#UsePrivilegeSeparation .*|UsePrivilegeSeparation sandbox|g' /etc/ssh/sshd_config sed -i 's|#UsePrivilegeSeparation .*|UsePrivilegeSeparation sandbox|g' /etc/ssh/sshd_config
sed -i 's|UsePrivilegeSeparation .*|UsePrivilegeSeparation sandbox|g' /etc/ssh/sshd_config sed -i 's|UsePrivilegeSeparation .*|UsePrivilegeSeparation sandbox|g' /etc/ssh/sshd_config