Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
base
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
puppetpublic
base
Commits
c193e736
Commit
c193e736
authored
9 years ago
by
Adam Lewenberg
Browse files
Options
Downloads
Patches
Plain Diff
first pass at allowing multiple ports in sshd config
parent
c3afd82d
Loading
Loading
Loading
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
manifests/ssh/config/sshd.pp
+5
-1
5 additions, 1 deletion
manifests/ssh/config/sshd.pp
templates/ssh/sshd_config.erb
+13
-3
13 additions, 3 deletions
templates/ssh/sshd_config.erb
with
18 additions
and
4 deletions
manifests/ssh/config/sshd.pp
+
5
−
1
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
,
)
{
...
...
This diff is collapsed.
Click to expand it.
templates/ssh/sshd_config.erb
+
13
−
3
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
%>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment