# sshd_permit_empty_passwords: If you want enable PermitEmptyPasswords to allow empty passwords
# Valid Values: yes or no
# Default: no
-
+#
+# sshd_port: If you want to specify a different port than the default 22
+# Default: 22
class sshd {
include sshd::client
'' => 'no',
default => $sshd_permit_empty_passwords
}
+ $real_sshd_port = $sshd_port ? {
+ '' => 22,
+ default => $sshd_port
+ }
file { 'sshd_config':
path => '/etc/ssh/sshd_config',
# possible, but leave them commented. Uncommented options change a
# default value.
-#Port 22
+<%- unless real_sshd_port.to_s.empty? then %>
+Port <%= real_sshd_port %>
+<%- else %>
+Port 22
+<%- end %>
+
#Protocol 2,1
Protocol 2
#AddressFamily any
# See the sshd(8) manpage for defails
# What ports, IPs and protocols we listen for
-# Port 22
+
+<%- unless real_sshd_port.to_s.empty? then %>
+Port <%= real_sshd_port %>
+<%- else %>
+Port 22
+<%- end %>
+
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
# possible, but leave them commented. Uncommented options change a
# default value.
-#Port 22
+<%- unless real_sshd_port.to_s.empty? then %>
+Port <%= real_sshd_port %>
+<%- else %>
+Port 22
+<%- end %>
+
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
# possible, but leave them commented. Uncommented options change a
# default value.
-#Port 22
+<%- unless real_sshd_port.to_s.empty? then %>
+Port <%= real_sshd_port %>
+<%- else %>
+Port 22
+<%- end %>
+
#Protocol 2,1
#AddressFamily any
#ListenAddress 0.0.0.0