summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2008-09-26 17:30:28 -0400
committerMicah Anderson <micah@riseup.net>2008-09-26 17:30:28 -0400
commit9edd2705d4c59ac8cb75a67b587d06d32cb5e6c6 (patch)
treeec918ac2f13b7bc7c76fba7662ce6c708ae8f0d8
parentba8d788f89e2e8676985b40553a9f6794a322217 (diff)
add sshd_ignore_rhosts option, default set to yes
-rw-r--r--manifests/init.pp4
-rw-r--r--templates/sshd_config/CentOS_normal.erb7
-rw-r--r--templates/sshd_config/Debian_normal.erb6
-rw-r--r--templates/sshd_config/Gentoo_normal.erb7
-rw-r--r--templates/sshd_config/OpenBSD_normal.erb7
5 files changed, 28 insertions, 3 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 858e1b5..cf089bc 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -121,6 +121,10 @@ class sshd::base {
'' => 'yes',
default => $sshd_strict_modes
}
+ $real_sshd_ignore_rhosts = $sshd_ignore_rhosts ? {
+ '' => 'yes',
+ default => $sshd_ignore_rhosts
+ }
file { 'sshd_config':
path => '/etc/ssh/sshd_config',
diff --git a/templates/sshd_config/CentOS_normal.erb b/templates/sshd_config/CentOS_normal.erb
index 849d9fb..e2b4005 100644
--- a/templates/sshd_config/CentOS_normal.erb
+++ b/templates/sshd_config/CentOS_normal.erb
@@ -70,8 +70,13 @@ PubkeyAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and HostbasedAuthentication
#IgnoreUserKnownHosts no
+
# Don't read the user's ~/.rhosts and ~/.shosts files
-#IgnoreRhosts yes
+<%- if real_sshd_pubkey_authentication.to_s == 'yes' then %>
+IgnoreRhosts yes
+<%- else %>
+IgnoreRhosts no
+<% end -%>
# To disable tunneled clear text passwords, change to no here!
<%- if real_sshd_password_authentication.to_s == 'yes' then %>
diff --git a/templates/sshd_config/Debian_normal.erb b/templates/sshd_config/Debian_normal.erb
index 7105dfd..155c4da 100644
--- a/templates/sshd_config/Debian_normal.erb
+++ b/templates/sshd_config/Debian_normal.erb
@@ -55,8 +55,14 @@ PubkeyAuthentication no
# rhosts authentication should not be used
#RhostsAuthentication no
+
# Don't read the user's ~/.rhosts and ~/.shosts files
+<%- if real_sshd_pubkey_authentication.to_s == 'yes' then %>
IgnoreRhosts yes
+<%- else %>
+IgnoreRhosts no
+<% end -%>
+
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
diff --git a/templates/sshd_config/Gentoo_normal.erb b/templates/sshd_config/Gentoo_normal.erb
index 04712bd..c8dbda4 100644
--- a/templates/sshd_config/Gentoo_normal.erb
+++ b/templates/sshd_config/Gentoo_normal.erb
@@ -73,8 +73,13 @@ PubkeyAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and HostbasedAuthentication
#IgnoreUserKnownHosts no
+
# Don't read the user's ~/.rhosts and ~/.shosts files
-#IgnoreRhosts yes
+<%- if real_sshd_pubkey_authentication.to_s == 'yes' then %>
+IgnoreRhosts yes
+<%- else %>
+IgnoreRhosts no
+<% end -%>
# To disable tunneled clear text passwords, change to no here!
<%- if real_sshd_password_authentication.to_s == 'yes' then %>
diff --git a/templates/sshd_config/OpenBSD_normal.erb b/templates/sshd_config/OpenBSD_normal.erb
index b7e4673..420f9cc 100644
--- a/templates/sshd_config/OpenBSD_normal.erb
+++ b/templates/sshd_config/OpenBSD_normal.erb
@@ -67,8 +67,13 @@ PubkeyAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and HostbasedAuthentication
#IgnoreUserKnownHosts no
+
# Don't read the user's ~/.rhosts and ~/.shosts files
-#IgnoreRhosts yes
+<%- if real_sshd_pubkey_authentication.to_s == 'yes' then %>
+IgnoreRhosts yes
+<%- else %>
+IgnoreRhosts no
+<% end -%>
# To disable tunneled clear text passwords, change to no here!
<%- if real_sshd_password_authentication.to_s == 'yes' then %>