From 27632475091a4938262dcc54545b0912f112534e Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 26 Jun 2017 13:13:39 +0100 Subject: [PATCH] Disable host based ssh authentication --- src/freedombone-utils-ssh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/freedombone-utils-ssh b/src/freedombone-utils-ssh index 28691e39..090c8a68 100755 --- a/src/freedombone-utils-ssh +++ b/src/freedombone-utils-ssh @@ -40,6 +40,12 @@ function configure_ssh { if [[ $(is_completed $FUNCNAME) == "1" ]]; then return fi + if ! grep 'HostbasedAuthentication' /etc/ssh/sshd_config; then + echo 'HostbasedAuthentication no' >> /etc/ssh/sshd_config + else + sed 's|#HostbasedAuthentication.*|HostbasedAuthentication no|g' /etc/ssh/sshd_config + sed 's|HostbasedAuthentication.*|HostbasedAuthentication no|g' /etc/ssh/sshd_config + fi sed -i 's|#IgnoreRhosts.*|IgnoreRhosts yes|g' /etc/ssh/sshd_config sed -i 's|IgnoreRhosts.*|IgnoreRhosts yes|g' /etc/ssh/sshd_config sed -i "s/Port .*/Port $SSH_PORT/g" /etc/ssh/sshd_config