]> git.openstreetmap.org Git - chef.git/commitdiff
openssh: disable password authentication by default (except dev)
authorGrant Slater <git@firefishy.com>
Thu, 31 Mar 2022 13:13:15 +0000 (14:13 +0100)
committerGrant <github@firefishy.com>
Thu, 31 Mar 2022 15:48:20 +0000 (16:48 +0100)
cookbooks/openssh/attributes/default.rb
cookbooks/openssh/templates/default/sshd_config.conf.erb
roles/dev.rb

index d829ee259f49fdaf34055c2fee3b46bc14a1fc82..7e5d783070834b01b88b514c908a2ef2dc971756 100644 (file)
@@ -1 +1,2 @@
 default[:openssh][:port] = 22
+default[:openssh][:password_authentication] = false
index 00a540a5e54e9d114d613d2a277220eb79027bd3..99e427cc450d2bfd3e886a3591f353a0a659348d 100644 (file)
@@ -1,3 +1,9 @@
 # DO NOT EDIT - This file is being maintained by Chef
 
 Port <%= node[:openssh][:port] %>
+
+<% if node[:openssh][:password_authentication] -%>
+PasswordAuthentication yes
+<% else -%>
+PasswordAuthentication no
+<% end -%>
index d546c7d1fda3c0c6e6a72f142b816353e2e63c32..3ba2b803f356b3ea7d565d39bf6d38083d9a98e9 100644 (file)
@@ -151,6 +151,9 @@ default_attributes(
         "kernel.shmmax" => "17179869184"
       }
     }
+  },
+  :openssh => {
+    :password_authentication => true
   }
 )