Bob Mottram 8 gadus atpakaļ
vecāks
revīzija
d235c8dbe4
1 mainītis faili ar 3 papildinājumiem un 4 dzēšanām
  1. 3
    4
      src/freedombone-utils-ssh

+ 3
- 4
src/freedombone-utils-ssh Parādīt failu

40
     if [[ $(is_completed $FUNCNAME) == "1" ]]; then
40
     if [[ $(is_completed $FUNCNAME) == "1" ]]; then
41
         return
41
         return
42
     fi
42
     fi
43
-    if ! grep 'HostbasedAuthentication' /etc/ssh/sshd_config; then
43
+    if ! grep -q 'HostbasedAuthentication' /etc/ssh/sshd_config; then
44
         echo 'HostbasedAuthentication no' >> /etc/ssh/sshd_config
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
45
     fi
46
+    sed 's|#HostbasedAuthentication.*|HostbasedAuthentication no|g' /etc/ssh/sshd_config
47
+    sed 's|HostbasedAuthentication.*|HostbasedAuthentication no|g' /etc/ssh/sshd_config
49
     sed -i 's|#PrintLastLog.*|PrintLastLog yes|g' /etc/ssh/sshd_config
48
     sed -i 's|#PrintLastLog.*|PrintLastLog yes|g' /etc/ssh/sshd_config
50
     sed -i 's|PrintLastLog.*|PrintLastLog yes|g' /etc/ssh/sshd_config
49
     sed -i 's|PrintLastLog.*|PrintLastLog yes|g' /etc/ssh/sshd_config
51
     sed -i 's|#IgnoreRhosts.*|IgnoreRhosts yes|g' /etc/ssh/sshd_config
50
     sed -i 's|#IgnoreRhosts.*|IgnoreRhosts yes|g' /etc/ssh/sshd_config