Explorar el Código

Disable the Debian banner which can be used to identify the Debian version from the publc ip

Bob Mottram hace 10 años
padre
commit
628c1840a1
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. 5
    0
      src/freedombone

+ 5
- 0
src/freedombone Ver fichero

@@ -3401,6 +3401,11 @@ function configure_ssh {
3401 3401
   sed -i 's/TCPKeepAlive.*/TCPKeepAlive no/g' /etc/ssh/sshd_config
3402 3402
   sed -i 's|HostKey /etc/ssh/ssh_host_dsa_key|#HostKey /etc/ssh/ssh_host_dsa_key|g' /etc/ssh/sshd_config
3403 3403
   sed -i 's|HostKey /etc/ssh/ssh_host_ecdsa_key|#HostKey /etc/ssh/ssh_host_ecdsa_key|g' /etc/ssh/sshd_config
3404
+  if ! grep -q 'DebianBanner' /etc/ssh/sshd_config; then
3405
+      echo 'DebianBanner no' >> /etc/ssh/sshd_config
3406
+  else
3407
+      sed -i 's|DebianBanner.*|DebianBanner no|g' /etc/ssh/sshd_config
3408
+  fi
3404 3409
   if grep -q 'ClientAliveInterval' /etc/ssh/sshd_config; then
3405 3410
       sed -i 's/ClientAliveInterval.*/ClientAliveInterval 60/g' /etc/ssh/sshd_config
3406 3411
   else