Bob Mottram hace 8 años
padre
commit
d235c8dbe4
Se han modificado 1 ficheros con 3 adiciones y 4 borrados
  1. 3
    4
      src/freedombone-utils-ssh

+ 3
- 4
src/freedombone-utils-ssh Ver fichero

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