diff --git a/src/freedombone-utils-ssh b/src/freedombone-utils-ssh index 65533d26..8c565d6e 100755 --- a/src/freedombone-utils-ssh +++ b/src/freedombone-utils-ssh @@ -13,7 +13,7 @@ # License # ======= # -# Copyright (C) 2014-2016 Bob Mottram +# Copyright (C) 2014-2017 Bob Mottram # # 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 @@ -40,6 +40,22 @@ function configure_ssh { if [[ $(is_completed $FUNCNAME) == "1" ]]; then return 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 echo 'HostbasedAuthentication no' >> /etc/ssh/sshd_config fi