More ssh server settings

This commit is contained in:
Bob Mottram 2017-06-29 13:35:53 +01:00
parent 5f8faa36e2
commit bbae177910
1 changed files with 17 additions and 1 deletions

View File

@ -13,7 +13,7 @@
# License # License
# ======= # =======
# #
# Copyright (C) 2014-2016 Bob Mottram <bob@freedombone.net> # Copyright (C) 2014-2017 Bob Mottram <bob@freedombone.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by # it under the terms of the GNU Affero General Public License as published by
@ -40,6 +40,22 @@ function configure_ssh {
if [[ $(is_completed $FUNCNAME) == "1" ]]; then if [[ $(is_completed $FUNCNAME) == "1" ]]; then
return return
fi fi
if ! grep -q 'RhostsRSAAuthentication' /etc/ssh/sshd_config; then
echo 'RhostsRSAAuthentication yes' >> /etc/ssh/sshd_config
else
sed -i 's|#RhostsRSAAuthentication.*|RhostsRSAAuthentication yes|g' /etc/ssh/sshd_config
fi
sed -i 's|#StrictModes.*|StrictModes yes|g' /etc/ssh/sshd_config
sed -i 's|StrictModes.*|StrictModes yes|g' /etc/ssh/sshd_config
sed -i 's|#KerberosAuthentication.*|KerberosAuthentication no|g' /etc/ssh/sshd_config
sed -i 's|KerberosAuthentication.*|KerberosAuthentication no|g' /etc/ssh/sshd_config
sed -i 's|#GSSAPIAuthentication.*|GSSAPIAuthentication no|g' /etc/ssh/sshd_config
sed -i 's|GSSAPIAuthentication.*|GSSAPIAuthentication no|g' /etc/ssh/sshd_config
sed -i 's|#IgnoreUserKnownHosts.*|IgnoreUserKnownHosts yes|g' /etc/ssh/sshd_config
sed -i 's|IgnoreUserKnownHosts.*|IgnoreUserKnownHosts yes|g' /etc/ssh/sshd_config
sed -i 's|#Compression.*|Compression delayed|g' /etc/ssh/sshd_config
sed -i 's|Compression.*|Compression delayed|g' /etc/ssh/sshd_config
if ! grep -q 'HostbasedAuthentication' /etc/ssh/sshd_config; then if ! grep -q 'HostbasedAuthentication' /etc/ssh/sshd_config; then
echo 'HostbasedAuthentication no' >> /etc/ssh/sshd_config echo 'HostbasedAuthentication no' >> /etc/ssh/sshd_config
fi fi