Add parameters to ssh_config and sshd_config
This commit is contained in:
parent
d3e8c6f4d6
commit
272b3e442d
66
README.md
66
README.md
@ -61,6 +61,24 @@ ssh_config's mode.
|
|||||||
|
|
||||||
- *Default*: '0644'
|
- *Default*: '0644'
|
||||||
|
|
||||||
|
ssh_config_forward_x11
|
||||||
|
----------------------
|
||||||
|
ForwardX11 option in ssh_config. Not set by default.
|
||||||
|
|
||||||
|
- *Default*: undef
|
||||||
|
|
||||||
|
ssh_config_forward_agent
|
||||||
|
------------------------
|
||||||
|
ForwardAgent option in ssh_config. Not set by default.
|
||||||
|
|
||||||
|
- *Default*: undef
|
||||||
|
|
||||||
|
ssh_config_server_alive_interval
|
||||||
|
--------------------------------
|
||||||
|
ServerAliveInterval option in ssh_config. Not set by default.
|
||||||
|
|
||||||
|
- *Default*: undef
|
||||||
|
|
||||||
sshd_config_path
|
sshd_config_path
|
||||||
----------------
|
----------------
|
||||||
Path to sshd_config.
|
Path to sshd_config.
|
||||||
@ -85,6 +103,54 @@ sshd_config's mode.
|
|||||||
|
|
||||||
- *Default*: '0600'
|
- *Default*: '0600'
|
||||||
|
|
||||||
|
sshd_config_syslog_facility
|
||||||
|
---------------------------
|
||||||
|
SyslogFacility option in sshd_config.
|
||||||
|
|
||||||
|
- *Default*: 'AUTH'
|
||||||
|
|
||||||
|
sshd_config_login_grace_time
|
||||||
|
----------------------------
|
||||||
|
LoginGraceTime option in sshd_config.
|
||||||
|
|
||||||
|
- *Default*: '120'
|
||||||
|
|
||||||
|
sshd_config_challenge_resp_auth
|
||||||
|
-------------------------------
|
||||||
|
ChallengeResponseAuthentication option in sshd_config.
|
||||||
|
|
||||||
|
- *Default*: 'no'
|
||||||
|
|
||||||
|
sshd_config_print_motd
|
||||||
|
----------------------
|
||||||
|
PrintMotd option in sshd_config.
|
||||||
|
|
||||||
|
- *Default*: 'yes'
|
||||||
|
|
||||||
|
sshd_config_use_dns
|
||||||
|
-------------------
|
||||||
|
UseDNS option in sshd_config.
|
||||||
|
|
||||||
|
- *Default*: 'yes'
|
||||||
|
|
||||||
|
sshd_config_banner
|
||||||
|
------------------
|
||||||
|
Banner option in sshd_config.
|
||||||
|
|
||||||
|
- *Default*: 'none'
|
||||||
|
|
||||||
|
sshd_config_xauth_location
|
||||||
|
--------------------------
|
||||||
|
XAuthLocation option in sshd_config.
|
||||||
|
|
||||||
|
- *Default*: '/usr/bin/xauth'
|
||||||
|
|
||||||
|
sshd_config_subsystem_sftp
|
||||||
|
--------------------------
|
||||||
|
Path to sftp file transfer subsystem in sshd_config.
|
||||||
|
|
||||||
|
- *Default*: '/usr/libexec/openssh/sftp-server'
|
||||||
|
|
||||||
service_ensure
|
service_ensure
|
||||||
--------------
|
--------------
|
||||||
Ensure SSH service is running. Valid values are 'stopped' and 'running'.
|
Ensure SSH service is running. Valid values are 'stopped' and 'running'.
|
||||||
|
@ -131,29 +131,40 @@
|
|||||||
# - *Default*: "# This file is being maintained by Puppet.\n# DO NOT EDIT\n"
|
# - *Default*: "# This file is being maintained by Puppet.\n# DO NOT EDIT\n"
|
||||||
#
|
#
|
||||||
class ssh (
|
class ssh (
|
||||||
$packages = ['openssh-server',
|
$packages = ['openssh-server',
|
||||||
'openssh-server',
|
'openssh-server',
|
||||||
'openssh-clients'],
|
'openssh-clients'],
|
||||||
$permit_root_login = 'no',
|
$permit_root_login = 'no',
|
||||||
$purge_keys = 'true',
|
$purge_keys = 'true',
|
||||||
$manage_firewall = false,
|
$manage_firewall = false,
|
||||||
$ssh_config_path = '/etc/ssh/ssh_config',
|
$ssh_config_path = '/etc/ssh/ssh_config',
|
||||||
$ssh_config_owner = 'root',
|
$ssh_config_owner = 'root',
|
||||||
$ssh_config_group = 'root',
|
$ssh_config_group = 'root',
|
||||||
$ssh_config_mode = '0644',
|
$ssh_config_mode = '0644',
|
||||||
$sshd_config_path = '/etc/ssh/sshd_config',
|
$ssh_config_forward_x11 = undef,
|
||||||
$sshd_config_owner = 'root',
|
$ssh_config_forward_agent = undef,
|
||||||
$sshd_config_group = 'root',
|
$ssh_config_server_alive_interval = undef,
|
||||||
$sshd_config_mode = '0600',
|
$sshd_config_path = '/etc/ssh/sshd_config',
|
||||||
$service_ensure = 'running',
|
$sshd_config_owner = 'root',
|
||||||
$service_name = 'sshd',
|
$sshd_config_group = 'root',
|
||||||
$service_enable = 'true',
|
$sshd_config_mode = '0600',
|
||||||
$service_hasrestart = 'true',
|
$sshd_config_syslog_facility = 'AUTH',
|
||||||
$service_hasstatus = 'true',
|
$sshd_config_login_grace_time = '120',
|
||||||
$ssh_key_ensure = 'present',
|
$sshd_config_challenge_resp_auth = 'no',
|
||||||
$ssh_key_type = 'ssh-rsa',
|
$sshd_config_print_motd = 'yes',
|
||||||
$manage_root_ssh_config = 'false',
|
$sshd_config_use_dns = 'yes',
|
||||||
$root_ssh_config_content = "# This file is being maintained by Puppet.\n# DO NOT EDIT\n",
|
$sshd_config_banner = 'none',
|
||||||
|
$sshd_config_xauth_location = '/usr/bin/xauth',
|
||||||
|
$sshd_config_subsystem_sftp = '/usr/libexec/openssh/sftp-server',
|
||||||
|
$service_ensure = 'running',
|
||||||
|
$service_name = 'sshd',
|
||||||
|
$service_enable = 'true',
|
||||||
|
$service_hasrestart = 'true',
|
||||||
|
$service_hasstatus = 'true',
|
||||||
|
$ssh_key_ensure = 'present',
|
||||||
|
$ssh_key_type = 'ssh-rsa',
|
||||||
|
$manage_root_ssh_config = 'false',
|
||||||
|
$root_ssh_config_content = "# This file is being maintained by Puppet.\n# DO NOT EDIT\n",
|
||||||
) {
|
) {
|
||||||
|
|
||||||
case $permit_root_login {
|
case $permit_root_login {
|
||||||
|
@ -50,6 +50,15 @@ Host *
|
|||||||
# to the original X11 display. As virtually no X11 client supports the untrusted
|
# to the original X11 display. As virtually no X11 client supports the untrusted
|
||||||
# mode correctly we set this to yes.
|
# mode correctly we set this to yes.
|
||||||
ForwardX11Trusted yes
|
ForwardX11Trusted yes
|
||||||
|
<% if @ssh_config_forward_agent -%>
|
||||||
|
ForwardAgent <%= @ssh_config_forward_agent %>
|
||||||
|
<% end -%>
|
||||||
|
<% if @ssh_config_forward_x11 -%>
|
||||||
|
ForwardX11 <%= @ssh_config_forward_x11 %>
|
||||||
|
<% end -%>
|
||||||
|
<% if @ssh_config_server_alive_interval -%>
|
||||||
|
ServerAliveInterval <%= @ssh_config_server_alive_interval %>
|
||||||
|
<% end -%>
|
||||||
# Send locale-related environment variables
|
# Send locale-related environment variables
|
||||||
SendEnv LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
|
SendEnv LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
|
||||||
SendEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
|
SendEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
|
||||||
|
@ -33,12 +33,13 @@ Protocol 2
|
|||||||
# Logging
|
# Logging
|
||||||
# obsoletes QuietMode and FascistLogging
|
# obsoletes QuietMode and FascistLogging
|
||||||
#SyslogFacility AUTH
|
#SyslogFacility AUTH
|
||||||
SyslogFacility AUTHPRIV
|
SyslogFacility <%= @sshd_config_syslog_facility %>
|
||||||
#LogLevel INFO
|
#LogLevel INFO
|
||||||
|
|
||||||
# Authentication:
|
# Authentication:
|
||||||
|
|
||||||
#LoginGraceTime 2m
|
#LoginGraceTime 120
|
||||||
|
LoginGraceTime <%= @sshd_config_login_grace_time %>
|
||||||
PermitRootLogin <%= @permit_root_login %>
|
PermitRootLogin <%= @permit_root_login %>
|
||||||
#StrictModes yes
|
#StrictModes yes
|
||||||
#MaxAuthTries 6
|
#MaxAuthTries 6
|
||||||
@ -64,7 +65,7 @@ PasswordAuthentication yes
|
|||||||
|
|
||||||
# Change to no to disable s/key passwords
|
# Change to no to disable s/key passwords
|
||||||
#ChallengeResponseAuthentication yes
|
#ChallengeResponseAuthentication yes
|
||||||
ChallengeResponseAuthentication no
|
ChallengeResponseAuthentication <%= @sshd_config_challenge_resp_auth %>
|
||||||
|
|
||||||
# Kerberos options
|
# Kerberos options
|
||||||
#KerberosAuthentication no
|
#KerberosAuthentication no
|
||||||
@ -100,6 +101,7 @@ X11Forwarding yes
|
|||||||
#X11DisplayOffset 10
|
#X11DisplayOffset 10
|
||||||
#X11UseLocalhost yes
|
#X11UseLocalhost yes
|
||||||
#PrintMotd yes
|
#PrintMotd yes
|
||||||
|
PrintMotd <%= @sshd_config_print_motd %>
|
||||||
#PrintLastLog yes
|
#PrintLastLog yes
|
||||||
#TCPKeepAlive yes
|
#TCPKeepAlive yes
|
||||||
#UseLogin no
|
#UseLogin no
|
||||||
@ -110,13 +112,18 @@ X11Forwarding yes
|
|||||||
#ClientAliveCountMax 3
|
#ClientAliveCountMax 3
|
||||||
#ShowPatchLevel no
|
#ShowPatchLevel no
|
||||||
#UseDNS yes
|
#UseDNS yes
|
||||||
|
UseDNS <%= @sshd_config_use_dns %>
|
||||||
#PidFile /var/run/sshd.pid
|
#PidFile /var/run/sshd.pid
|
||||||
#MaxStartups 10
|
#MaxStartups 10
|
||||||
#PermitTunnel no
|
#PermitTunnel no
|
||||||
#ChrootDirectory none
|
#ChrootDirectory none
|
||||||
|
|
||||||
# no default banner path
|
# no default banner path
|
||||||
##Banner /etc/motd
|
#Banner none
|
||||||
|
Banner <%= @sshd_config_banner %>
|
||||||
|
|
||||||
|
#XAuthLocation /usr/bin/xauth
|
||||||
|
XAuthLocation <%= @sshd_config_xauth_location %>
|
||||||
|
|
||||||
# override default of no subsystems
|
# override default of no subsystems
|
||||||
Subsystem sftp /usr/libexec/openssh/sftp-server
|
Subsystem sftp <%= @sshd_config_subsystem_sftp %>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user