Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Lonlone Lee
base
Commits
c193e736
Commit
c193e736
authored
Feb 04, 2016
by
Adam Lewenberg
Browse files
first pass at allowing multiple ports in sshd config
parent
c3afd82d
Changes
2
Hide whitespace changes
Inline
Side-by-side
manifests/ssh/config/sshd.pp
View file @
c193e736
# Create the sshd configuration.
# listen_addresses: If you want to restrict the ssh service to listen only at
#
$
listen_addresses: If you want to restrict the ssh service to listen only at
# certain addresses, specify with this parameter. Enter them as a
# comma-delimited list.
#
...
...
@@ -14,6 +14,9 @@
# omitted from the sshd configuration file (which is equivalent to having
# sshd listen at _all_ addresses).
#
# $listen_ports: a comma-delimited list of ports to listen to. Defaults to
# "22". Example: "22,44".
#
# If you want to allow root to log in with a password, set
# rootloginwithpswd 'yes'. Otherwise, root logins with a password
# are not allowed.
...
...
@@ -33,6 +36,7 @@ define base::ssh::config::sshd(
$source
=
undef
,
$max_tries
=
5
,
$listen_addresses
=
'all'
,
$listen_ports
=
'22'
,
$rootloginwithpswd
=
'no'
,
$pam_duo
=
false
,
)
{
...
...
templates/ssh/sshd_config.erb
View file @
c193e736
...
...
@@ -4,11 +4,21 @@
# GSS-API. It will eventually become the default. The default configuration
# values that we don't change are omitted from this file.
Port 22
<%-
# Split the ports at the commas.
ports
=
@listen_ports
.
split
(
','
)
ports
.
each
do
|
port
|
-%>
Port
<%=
port
%>
<%
end
-%>
<%
if
(
listen_addresses
!=
'all'
)
if
(
@
listen_addresses
!=
'all'
)
# Split the addresses at the commas.
addresses
=
listen_addresses
.
split
(
','
)
addresses
=
@
listen_addresses
.
split
(
','
)
addresses
.
each
do
|
address
|
-%>
ListenAddress
<%=
address
%>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment