Browse Source

Disable host based ssh authentication

Bob Mottram 7 years ago
parent
commit
2763247509
1 changed files with 6 additions and 0 deletions
  1. 6
    0
      src/freedombone-utils-ssh

+ 6
- 0
src/freedombone-utils-ssh View File

@@ -40,6 +40,12 @@ function configure_ssh {
40 40
     if [[ $(is_completed $FUNCNAME) == "1" ]]; then
41 41
         return
42 42
     fi
43
+    if ! grep 'HostbasedAuthentication' /etc/ssh/sshd_config; then
44
+        echo 'HostbasedAuthentication no' >> /etc/ssh/sshd_config
45
+    else
46
+        sed 's|#HostbasedAuthentication.*|HostbasedAuthentication no|g' /etc/ssh/sshd_config
47
+        sed 's|HostbasedAuthentication.*|HostbasedAuthentication no|g' /etc/ssh/sshd_config
48
+    fi
43 49
     sed -i 's|#IgnoreRhosts.*|IgnoreRhosts yes|g' /etc/ssh/sshd_config
44 50
     sed -i 's|IgnoreRhosts.*|IgnoreRhosts yes|g' /etc/ssh/sshd_config
45 51
     sed -i "s/Port .*/Port $SSH_PORT/g" /etc/ssh/sshd_config