ssh

Manage ssh

26,798 downloads

184 latest version

5.0 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 6.20.0 (latest)
  • 6.19.0
  • 6.18.2
  • 6.18.1
  • 6.18.0
  • 6.17.1
  • 6.16.1
  • 6.16.0
  • 6.14.0
  • 6.13.1
  • 6.13.0
  • 6.12.0
  • 6.11.2
  • 6.11.1
  • 6.11.0
  • 6.9.0
  • 6.8.1
  • 6.8.0
  • 6.7.1
  • 6.7.0
  • 6.6.0 (deleted)
  • 6.5.1
  • 6.4.4
  • 6.4.3
  • 6.4.2
  • 6.4.1
  • 6.3.0
  • 6.2.1
  • 6.2.0
  • 6.1.0
  • 4.1.13
  • 4.1.12
  • 4.1.11
released Jun 11th 2019
This version is compatible with:
  • Puppet Enterprise 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x
  • Puppet >= 5.0.0 < 7.0.0
  • , ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'simp-ssh', '6.7.1'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add simp-ssh
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install simp-ssh --version 6.7.1

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

simp/ssh — version 6.7.1 Jun 11th 2019

Reference

Table of Contents

Classes

Defined types

Resource types

Functions

Classes

ssh

Sets up files for ssh.

Parameters

The following parameters are available in the ssh class.

enable_client

Data type: Boolean

If true, set up the SSH client configuration files.

Default value: true

enable_server

Data type: Boolean

If true, set up an SSH server on the system.

Default value: true

ssh::authorized_keys

This class was designed so you can just paste the output of the ssh pubkey into hiera and it will work. See the example below for details.

WARNING

This creates a user for every key and every user in the Hash. If this is large, please consider moving to a central source for these keys, such as LDAP, so that you do not over-burden your Puppet server.

WARNING

Examples

Adding user keys via Hiera
---
ssh::authorized_keys::keys:
  kelly: ssh-rsa skjfhslkdjfs...
  nick:
  - ssh-rsa sajhgfsaihd...
  - ssh-rsa jrklsahsgfs...
  mike:
    key: ssh-rsa dlfkjsahh...
    user: mlast
    target: /home/gitlab-runner/.ssh/authorized_keys

Parameters

The following parameters are available in the ssh::authorized_keys class.

keys

Data type: Hash

The hash to generate key resouces from

Default value: {}

ssh::client

Sets up a ssh client and creates /etc/ssh/ssh_config.

Parameters

The following parameters are available in the ssh::client class.

add_default_entry

Data type: Boolean

Set this if you wish to automatically have the '*' Host entry set up with some sane defaults.

Default value: true

fips

Data type: Boolean

If set or FIPS is already enabled, adjust for FIPS mode.

Default value: simplib::lookup('simp_options::fips', { 'default_value' => false })

haveged

Data type: Boolean

If true, include the haveged module to assist with entropy generation.

Default value: simplib::lookup('simp_options::haveged', { 'default_value' => false })

package_ensure

Data type: String

The ensure status the openssh-clients package

Default value: simplib::lookup('simp_options::package_ensure', { 'default_value' => 'installed' })

ssh::client::params

Default parameters for the SSH client

ssh::server

Sets up a ssh server and starts sshd.

Parameters

The following parameters are available in the ssh::server class.

server_ensure

Data type: String

The ensure status of the openssh-server package

Default value: simplib::lookup('simp_options::package_ensure', { 'default_value' => 'installed' })

ldap_ensure

Data type: String

The ensure status of the openssh-ldap package

Default value: simplib::lookup('simp_options::package_ensure', { 'default_value' => 'installed' })

ssh::server::conf

sshd configuration variables can be set using Augeas outside of this class with no adverse effects.

SSH Parameters ####

Custom Parameters ####

SIMP Parameters ####

Parameters

The following parameters are available in the ssh::server::conf class.

acceptenv

Data type: Array[String]

Specifies what environment variables sent by the client will be copied into the sessions environment.

Default value: $ssh::server::params::acceptenv

allowgroups

Data type: Optional[Array[String]]

A list of group name patterns. If specified, login is allowed only for users whose primary or supplementary group list matches one of the patterns.

Default value: undef

allowusers

Data type: Optional[Array[String]]

A list of user name patterns. If specified, login is allowed only for users whose name matches one of the patterns.

Default value: undef

authorizedkeysfile

Data type: String

This is set to a non-standard location to provide for increased control over who can log in as a given user.

Default value: '/etc/ssh/local_keys/%u'

authorizedkeyscommand

Data type: Optional[Stdlib::Absolutepath]

Specifies a program to be used for lookup of the user's public keys.

Default value: undef

authorizedkeyscommanduser

Data type: String

Specifies the user under whose account the AuthorizedKeysCommand is run.

Default value: 'nobody'

banner

Data type: Stdlib::Absolutepath

The contents of the specified file are sent to the remote user before authentication is allowed.

Default value: '/etc/issue.net'

challengeresponseauthentication

Data type: Boolean

Specifies whether challenge-response authentication is allowed.

Default value: false

ciphers

Data type: Optional[Array[String]]

Specifies the ciphers allowed for protocol version 2. When unset, a strong set of ciphers is automatically selected by this class, taking into account whether the server is in FIPS mode.

Default value: undef

clientalivecountmax

Data type: Integer

@see man page for sshd_config

Default value: 0

clientaliveinterval

Data type: Integer

@see man page for sshd_config

Default value: 600

compression

Data type: Variant[Boolean,Enum['delayed']]

Specifies whether compression is allowed, or delayed until the user has authenticated successfully.

Default value: 'delayed'

denygroups

Data type: Optional[Array[String]]

A list of group name patterns. If specified, login is disallowed for users whose primary or supplementary group list matches one of the patterns.

Default value: undef

denyusers

Data type: Optional[Array[String]]

A list of user name patterns. If specified, login is disallowed for users whose name matches one of the patterns.

Default value: undef

gssapiauthentication

Data type: Boolean

Specifies whether user authentication based on GSSAPI is allowed. If the system is connected to an IPA domain, this will be default to true, based on the existance of the ipa fact.

Default value: $ssh::server::params::gssapiauthentication

hostbasedauthentication

Data type: Boolean

@see man page for sshd_config

Default value: false

ignorerhosts

Data type: Boolean

@see man page for sshd_config

Default value: true

ignoreuserknownhosts

Data type: Boolean

@see man page for sshd_config

Default value: true

kerberosauthentication

Data type: Boolean

@see man page for sshd_config

Default value: false

kex_algorithms

Data type: Optional[Array[String]]

Specifies the key exchange algorithms accepted. When unset, an appropriate set of algorithms is automatically selected by this class, taking into account whether the server is in FIPS mode and whether the version of openssh installed supports this feature.

Default value: undef

listenaddress

Data type: Optional[Variant[Simplib::Host, Array[Simplib::Host]]]

Specifies the local addresses sshd should listen on.

  • WARNING: On EL6 systems, if sshd was listening on both IPv4 and IPv6 and you set this to an IPv4-only address (even 0.0.0.0), the service restart will erase the file /var/run/sshd.pid and the service will no longer be manageable from the service command until either the system is restarted or the pidfile is recreated correctly.

Default value: undef

logingracetime

Data type: Integer[0]

The max number of seconds the server will wait for a successful login before disconnecting. If the value is 0, there is no limit.

Default value: 120

ssh_loglevel

Data type: Optional[Ssh::Loglevel]

Specifies the verbosity level that is used when logging messages from sshd.

Default value: undef

macs

Data type: Optional[Array[String]]

Specifies the available MAC algorithms. When unset, a strong set of ciphers is automatically selected by this class, taking into account whether the server is in FIPS mode.

Default value: undef

maxauthtries

Data type: Integer[1]

Specifies the maximum number of authentication attempts permitted per connection.

Default value: 6

passwordauthentication

Data type: Boolean

Enable password authentication on the sshd server. If set to undef, this setting will not be managed.

  • Note: This setting must be managed by default so that switching to and from OATH does not lock you out of your system.

Default value: true

permitemptypasswords

Data type: Boolean

When password authentication is allowed, it specifies whether the server allows login to accounts with empty password strings.

Default value: false

permitrootlogin

Data type: Ssh::PermitRootLogin

Specifies whether root can log in using SSH.

Default value: false

permituserenvironment

Data type: Boolean

@see man page for sshd_config

Default value: false

port

Data type: Simplib::Port

Specifies the port number SSHD listens on.

Default value: 22

printlastlog

Data type: Boolean

Specifies whether SSHD should print the date and time of the last user login when a user logs in interactively.

Default value: false

protocol

Data type: Array[Integer[1,2]]

@see man page for sshd_config

Default value: [2]

rhostsrsaauthentication

Data type: Optional[Boolean]

This sshd option has been completely removed in openssh 7.4 and will cause an error message to be logged, when present. On systems using openssh 7.4 or later, only set this value if you need RhostsRSAAuthentication to be in the sshd configuration file to satisfy an outdated, STIG check.

Default value: $ssh::server::params::rhostsrsaauthentication

strictmodes

Data type: Boolean

@see man page for sshd_config

Default value: true

subsystem

Data type: String

Configures and external subsystem for file transfers.

Default value: 'sftp /usr/libexec/openssh/sftp-server'

syslogfacility

Data type: Ssh::Syslogfacility

Gives the facility code that is used when logging messages.

Default value: 'AUTHPRIV'

tcpwrappers

Data type: Boolean

If true, enable sshd tcpwrappers.

Default value: simplib::lookup('simp_options::tcpwrappers', { 'default_value' => false })

usepam

Data type: Boolean

Enables the Pluggable Authentication Module interface.

Default value: simplib::lookup('simp_options::pam', { 'default_value' => true })

manage_pam_sshd

Data type: Boolean

Flag indicating whether or not to mangae the pam stack for sshd. This is required for the oath option to work properly.

Default value: $oath

oath

Data type: Boolean

EXPERIMENTAL FEATURE Configures ssh to use pam_oath TOTP in the sshd pam stack. Also configures sshd_config to use required settings. Inherits from simp_options::oath, defaults to false if not found.

  • WARNING: If this setting is enabled then disabled and passwordauthentication is unmanaged, this will be set to no in sshd_config!

Default value: simplib::lookup('simp_options::oath', { 'default_value' => false })

oath_window

Data type: Integer[0]

Sets the TOTP window (Defined in RFC 6238 section 5.2)

Default value: 1

useprivilegeseparation

Data type: Variant[Boolean,Enum['sandbox']]

Specifies whether sshd separates privileges by creating an unprivileged child process to deal with incoming network traffic.

Default value: $ssh::server::params::useprivilegeseparation

x11forwarding

Data type: Boolean

Specifies whether X11 forwarding is permitted.

Default value: false

custom_entries

Data type: Optional[Hash[String[1],NotUndef]]

A Hash of key/value pairs that will be added as sshd_config resources without any validation.

  • NOTE: Due to complexity, Match entries are not supported and will need to be added using sshd_config_match resources as described in augeasproviders_ssh

@example Set AuthorizedPrincipalsCommand


ssh::server::conf::custom_entries: AuthorizedPrincipalsCommand: '/usr/local/bin/my_auth_command'

Default value: undef

app_pki_external_source

Data type: String

  • If pki = 'simp' or true, this is the directory from which certs will be copied, via pki::copy. Defaults to /etc/pki/simp/x509.

  • If pki = false, this variable has no effect.

Default value: simplib::lookup('simp_options::pki::source', { 'default_value' => '/etc/pki/simp/x509' })

app_pki_key

Data type: Stdlib::Absolutepath

Path and name of the private SSL key file. This key file is used to generate the system SSH certificates for consistency.

Default value: "/etc/pki/simp_apps/sshd/x509/private/${facts['fqdn']}.pem"

enable_fallback_ciphers

Data type: Boolean

If true, add the fallback ciphers from ssh::server::params to the cipher list. This is intended to provide compatibility with non-SIMP systems in a way that properly supports FIPS 140-2.

Default value: true

fallback_ciphers

Data type: Array[String]

The set of ciphers that should be used should no other cipher be declared. This is used when $ssh::server::conf::enable_fallback_ciphers is enabled.

Default value: $ssh::server::params::fallback_ciphers

fips

Data type: Boolean

If set or FIPS is already enabled, adjust for FIPS mode.

Default value: simplib::lookup('simp_options::fips', { 'default_value' => false })

firewall

Data type: Boolean

If true, use the SIMP iptables class.

Default value: simplib::lookup('simp_options::firewall', { 'default_value' => false })

haveged

Data type: Boolean

If true, include the haveged module to assist with entropy generation.

Default value: simplib::lookup('simp_options::haveged', { 'default_value' => false })

ldap

Data type: Boolean

If true, enable LDAP support on the system. If authorizedkeyscommand is empty, this will set the authorizedkeyscommand to ssh-ldap-wrapper so that SSH public keys can be stored directly in LDAP.

Default value: simplib::lookup('simp_options::ldap', { 'default_value' => false })

pki

Data type: Variant[Enum['simp'],Boolean]

  • If 'simp', include SIMP's pki module and use pki::copy to manage application certs in /etc/pki/simp_apps/sshd/x509
  • If true, do not include SIMP's pki module, but still use pki::copy to manage certs in /etc/pki/simp_apps/sshd/x509
  • If false, do not include SIMP's pki module and do not use pki::copy to manage certs. You will need to appropriately assign a subset of:
    • app_pki_dir
    • app_pki_key
    • app_pki_cert
    • app_pki_ca
    • app_pki_ca_dir

Default value: simplib::lookup('simp_options::pki', { 'default_value' => false })

sssd

Data type: Boolean

If true, use sssd

Default value: simplib::lookup('simp_options::sssd', { 'default_value' => false })

trusted_nets

Data type: Simplib::Netlist

The networks to allow to connect to SSH.

Default value: ['ALL']

ssh::server::params

  • KexAlgorithm configuration was not added until openssh 5.7
  • Curve exchange was not fully supported until openssh 6.5

Defined types

ssh::client::host_config_entry

GSSAPI may be used.

the client's GSSAPI credentials will force the rekeying of the ssh connection.

trusted to securely canonicalize the name of the host being connected to.

Examples

Adding default entry

ssh::client::host_config_entry { '*':
  gssapiauthentication => true,
  forwardx11trusted    => true'
}

Parameters

The following parameters are available in the ssh::client::host_config_entry defined type.

target

Data type: Stdlib::Absolutepath

Absolute path to the ssh_config file to manage.

Default value: '/etc/ssh/ssh_config'

address_family

Data type: Enum['any', 'inet', 'inet6']

The IP Address family to use when connecting. Valid options: 'any', 'inet', 'inet6'.

Default value: 'any'

batchmode

Data type: Boolean

If set to true, passphrase/password querying will be disabled. This option is useful in scripts and other batch jobs where no user is present to supply the password.

Default value: false

bindaddress

Data type: Optional[Simplib::Host]

Use the specified address on the local machine as the source address of the connection. Only useful on systems with more than one address. Note that this option does not work if UsePrivilegedPort is set to false.

Default value: undef

challengeresponseauthentication

Data type: Boolean

Specifies whether to use challenge-response authentication.

Default value: true

checkhostip

Data type: Boolean

If this flag is set to true, ssh will additionally check the host IP address in the known_hosts file. This allows ssh to detect if a host key changed due to DNS spoofing and will add addresses of destination hosts to ~/.ssh/known_hosts in the process, regardless of the setting of StrictHostKeyChecking.

Default value: true

cipher

Data type: Enum['blowfish', '3des', 'des']

Specifies the cipher to use for encrypting the session in protocol version 1. Valid Options: 'blowfish', '3des', 'des'.

Default value: '3des'

ciphers

Data type: Optional[Array[String]]

Specifies the ciphers allowed for protocol version 2 in order of preference. When unset, a strong set of ciphers is automatically selected by this class, taking into account whether the server is in FIPS mode.

Default value: undef

clearallforwardings

Data type: Boolean

Specifies that all local, remote, and dynamic port forwardings specified in the configuration files or on the command line be cleared.

Default value: false

compression

Data type: Boolean

Specifies whether to use compression.

Default value: true

compressionlevel

Data type: Integer[1,9]

Specifies the compression level to use if compression is enabled.

Default value: 6

connectionattempts

Data type: Integer[1]

Specifies the number of tries (one per second) to make before exiting.

Default value: 1

connecttimeout

Data type: Integer[0]

Specifies the timeout (in seconds) used when connecting to the SSH server, instead of using the default system TCP timeout.

Default value: 0

controlmaster

Data type: Enum['yes','no','ask']

Enables the sharing of multiple sessions over a single network connection.

Default value: 'no'

controlpath

Data type: Optional[Variant[Stdlib::Absolutepath, Enum['none']]]

Specify the path to the control socket used for connection sharing as set by controlmaster.

Default value: undef

dynamicforward

Data type: Optional[Variant[Simplib::Port, Simplib::Host::Port]]

Specifies that a TCP port on the local machine be forwarded over the secure channel, and the application protocol is then used to determine where to connect to from the remote machine.

Default value: undef

enablesshkeysign

Data type: Boolean

Setting this option to true enables the use of the helper program ssh-keysign during HostbasedAuthentication.

Default value: false

escapechar

Data type: Pattern[/^[[:graph:]]$/, /^\^[[:alpha:]]$/, /^none$/]

Sets the default escape character. Must be a single character.

Default value: '~'

exitonforwardfailure

Data type: Boolean

Specifies whether ssh should terminate the connection if it cannot set up all requested dynamic, tunnel, local, and remote port forwardings.

Default value: false

forwardagent

Data type: Boolean

Specifies whether the connection to the authentication agent (if any) will be forwarded to the remote machine.

Default value: false

forwardx11

Data type: Boolean

Specifies whether X11 connections will be automatically redirected over the secure channel and DISPLAY set.

Default value: false

forwardx11trusted

Data type: Boolean

If set to true, remote X11 clients will have full access to the original X11 display.

Default value: false

gatewayports

Data type: Boolean

Specifies whether remote hosts are allowed to connect to local forwarded ports.

Default value: false

globalknownhostsfile

Data type: Optional[Array[Stdlib::Absolutepath]]

Specifies one or more files to use for the global host key database.

Default value: undef

gssapiauthentication

Data type: Boolean

Specifies whether user authentication based on GSSAPI is allowed. If the system is connected to an IPA domain, this will be set to true, regardless of this parameter. It uses the ipa fact to determine domain membership.

Default value: false

gssapidelegatecredentials

Data type: Boolean

Forward credentials to the server.

Default value: false

gssapikeyexchange

Data type: Boolean

Specifies whether key exchange based on

Default value: false

gssapirenewalforcesrekey

Data type: Boolean

If set to true then renewal of

Default value: false

gssapitrustdns

Data type: Boolean

Set to true to indicate that the DNS is

Default value: false

hashknownhosts

Data type: Boolean

Indicates that SSH should hash host names and addresses when they are added to known hosts.

Default value: true

hostbasedauthentication

Data type: Boolean

Specifies whether to try rhosts based authentication with public key authentication.

Default value: false

hostkeyalgorithms

Data type: Array[String]

Specifies the host key algorithms that the client wants to use in order of preference.

Default value: ['ssh-rsa','ssh-dss']

hostkeyalias

Data type: Optional[String]

Specifies an alias that should be used instead of the real host name when looking up or saving the host key in the host key database files.

Default value: undef

hostname

Data type: Optional[Simplib::Host]

Specifies the real hostname to log into.

Default value: undef

identitiesonly

Data type: Boolean

Specifies that ssh should only use the authentication identity and certificate files explicitly configured in the ssh_config files or passed on the ssh command-line, even if ssh-agent or a PKCS11Provider offers more identities.

Default value: false

identityfile

Data type: Optional[String]

Specifies a file from which the user's DSA, ECDSA, Ed25519 or RSA authentication identity is read.

Default value: undef

kbdinteractiveauthentication

Data type: Boolean

Specifies whether to use keyboard-interactive authentication.

Default value: true

kbdinteractivedevices

Data type: Optional[Array[String]]

Specifies the list of methods to use in keyboard-interactive authentication. Multiple method names must be comma-separated.

Default value: undef

localcommand

Data type: Optional[String]

Specifies a command to execute on the local machine after successfully connecting to the server.

Default value: undef

localforward

Data type: Optional[String]

Specifies that a TCP port on the local machine be forwarded over the secure channel to the specified host and port from the remote machine. The first argument must be [bind_address:]port and the second argument must be host:hostport.

Default value: undef

ssh_loglevel

Data type: Ssh::Loglevel

Gives the verbosity level that is used when logging messages. Valid options: 'QUIET', 'FATAL', 'ERROR', 'INFO', 'VERBOSE', 'DEBUG', 'DEBUG1', 'DEBUG2', and 'DEBUG3'.

Default value: 'INFO'

macs

Data type: Optional[Array[String]]

Specifies the MAC (message authentication code) algorithms in order of preference. When unset, a strong set of algorithms is automatically selected by this class, taking into account whether the server is in FIPS mode.

Default value: undef

nohostauthenticationforlocalhost

Data type: Boolean

This option can be used if the home directory is shared across machines. In this case localhost will refer to a different machine on each of the machines and the user will get many warnings about changed host keys. However, this option disables host authentication for localhost.

Default value: false

numberofpasswordprompts

Data type: Integer[1]

Specifies the number of password prompts before giving up.

Default value: 3

passwordauthentication

Data type: Boolean

Specifies whether to use password authentication.

Default value: true

permitlocalcommand

Data type: Boolean

Allow local command execution via the LocalCommand option or using the !command escape sequence.

Default value: false

port

Data type: Simplib::Port

Specifies the port number to connect on the remote host.

Default value: 22

preferredauthentications

Data type: Array[Ssh::Authentications]

Specifies the order in which the client should try authentication methods. The order will be determined from the start of the array to the end of the array. Default: ['publickey','hostbased','keyboard-interactive','password']

Default value: [ 'publickey', 'hostbased', 'keyboard-interactive', 'password' ]

protocol

Data type: Variant[Integer[1,2], Enum['2,1']]

Specifies the protocol versions SSH should support.

Default value: 2

proxycommand

Data type: Optional[String]

Specifies the command to use to connect to the server.

Default value: undef

pubkeyauthentication

Data type: Boolean

Specifies whether to try public key authentication.

Default value: true

rekeylimit

Data type: Optional[String]

Specifies the maximum amount of data that may be transmitted before the session key is renegotiated, optionally followed a maximum amount of time that may pass before the session key is renegotiated.

Default value: undef

remoteforward

Data type: Optional[String]

Specifies that a TCP port on the remote machine be forwarded over the secure channel to the specified host and port from the local machine.

Default value: undef

rhostsrsaauthentication

Data type: Boolean

Specifies whether to try rhosts based authentication with RSA host authentication.

Default value: false

rsaauthentication

Data type: Boolean

Specifies whether to try RSA Authentication.

Default value: true

sendenv

Data type: Array[String]

Specifies what variables from the local environ should be sent to the server.

Default value: [ 'LANG', 'LC_CTYPE', 'LC_NUMERIC', 'LC_TIME', 'LC_COLLATE', 'LC_MONETARY', 'LC_MESSAGES', 'LC_PAPER', 'LC_NAME', 'LC_ADDRESS', 'LC_TELEPHONE', 'LC_MEASUREMENT', 'LC_IDENTIFICATION', 'LC_ALL' ]

serveralivecountmax

Data type: Integer[1]

Sets the number of server alive messages (see below) which may be sent without ssh receiving any messages back from the server.

Default value: 3

serveraliveinterval

Data type: Integer[0]

Sets a timeout interval in seconds after which if no data has been received from the server. The default is 0, indicating that these messages will not be sent to the server.

Default value: 0

smartcarddevice

Data type: Optional[String]

Specifies which smartcard device to use.

Default value: undef

stricthostkeychecking

Data type: Enum['yes','no','ask']

If set to yes, ssh will never automatically add host keys to the known_hosts file, and refuses to connect to hosts whose keys have changed. If this flag is set to "ask", new host keys will be added to the user known host files only after the user has confirmed that is what they really want to do, and ssh will refuse to connect to hosts whose host key has changed. Valid Options: 'yes', 'no', 'ask'

Default value: 'ask'

tcpkeepalive

Data type: Boolean

Specifies whether the system should send TCP keepalive messages to the other side.

Default value: true

tunnel

Data type: Enum['yes','no','point-to-point','ethernet']

If 'yes', request device forwarding between the client and server.

Default value: 'yes'

tunneldevice

Data type: Optional[String]

Specifies the devices to open on the client and the server.

Default value: undef

useprivilegedport

Data type: Boolean

Specifies whether to use a privileged port for outgoing connections.

Default value: false

user

Data type: Optional[String]

Specifies the user to log in as.

Default value: undef

userknownhostsfile

Data type: Optional[Array[Stdlib::Absolutepath]]

Specifies one or more files to use for the user host key database, separated by whitespace.

Default value: undef

verifyhostkeydns

Data type: Enum['yes','no','ask']

Specifies whether to verify the remote key using DNS and SSHFP resource records.

Default value: 'no'

visualhostkey

Data type: Boolean

If this flag is set to true, an ASCII art representation of the remote host key fingerprint is printed in addition to the fingerprint string at login and for unknown host keys.

Default value: false

xauthlocation

Data type: Stdlib::Absolutepath

Specifies the full pathname of the xauth program.

Default value: '/usr/bin/xauth'

Resource types

sshkey_prune

The file that you wish to prune

Properties

The following properties are available in the sshkey_prune type.

prune

Valid values: true, false

Whether or not to prune the file in $name

Default value: true

Parameters

The following parameters are available in the sshkey_prune type.

name

namevar

The file that you wish to prune

Functions

ssh::autokey

Type: Ruby 4.x API

user.

Keys are stored in "Puppet[:vardir]/simp/environments//simp_autofiles/ssh_autokeys"

Note: This function if marked as an InternalFunction because it changes the state of the system by writing key files.

ssh::autokey(String $username, Optional[Hash] $options)

The following options are supported:

  • 'key_strength': key length, Integer, defaults to 2048
  • 'return_private': whether to return the private key, Boolean, defaults to false NOTE: A minimum key strength of 1024 is enforced!

Returns: String The public key of the user

username

Data type: String

username for which SSH key pairs will be generated

options

Data type: Optional[Hash]

Options hash

ssh::autokey(String $username, Optional[Integer] $key_strength, Optional[Boolean] $return_private)

NOTE: A minimum key strength of 1024 is enforced!

Returns: String The public key of the user or the private key if return_private is specified.

username

Data type: String

username for which SSH key pairs will be generated

key_strength

Data type: Optional[Integer]

key length, defaults to 2048

return_private

Data type: Optional[Boolean]

whether to return the private key, defaults to false

ssh::config_bool_translate

Type: Ruby 4.x API

All other values are passed-through unchanged

ssh::config_bool_translate(String $config_item)

The ssh::config_bool_translate function.

Returns: Any transformed config_item

config_item

Data type: String

Configuration item to be translated

ssh::config_bool_translate(Boolean $config_item)

The ssh::config_bool_translate function.

Returns: Any transformed config_item

config_item

Data type: Boolean

Configuration item to be translated

ssh::format_host_entry_for_sorting

Type: Ruby 4.x API

wildcards and question marks.

The output is intended for use with the simpcat_fragment type and is not meant for use as a host entry itself.

The general idea is that it places all items at the bottom of the list using zzzz, then sorts by question marks first per section then wildcards per section.

Example: Input: '*' Output: 'zzzz98_st__'

Input: '*.foo.bar' Output: 'zzzz96_st__.foo.bar'

Input: 'foo.?.bar' Output: 'foo.zzzz95_qu__.bar'

Input: 'foo?.*.bar' Output: 'foozzzz96_qu.zzzz95_st.bar'

ssh::format_host_entry_for_sorting(String $host_entry)

wildcards and question marks.

The output is intended for use with the simpcat_fragment type and is not meant for use as a host entry itself.

The general idea is that it places all items at the bottom of the list using zzzz, then sorts by question marks first per section then wildcards per section.

Example: Input: '*' Output: 'zzzz98_st__'

Input: '*.foo.bar' Output: 'zzzz96_st__.foo.bar'

Input: 'foo.?.bar' Output: 'foo.zzzz95_qu__.bar'

Input: 'foo?.*.bar' Output: 'foozzzz96_qu.zzzz95_st.bar'

Returns: Any transformed host_entry

host_entry

Data type: String

SSH host entry, which may contain wildcards

ssh::global_known_hosts

Type: Ruby 4.x API

removing duplicates, and creating catalog resources that are found

Note: This function if marked as an InternalFunction because it changes the state of the system by adding/removing files and adding catalog resources.

ssh::global_known_hosts(Optional[Integer] $expire_days)

removing duplicates, and creating catalog resources that are found

Note: This function if marked as an InternalFunction because it changes the state of the system by adding/removing files and adding catalog resources.

Returns: None

expire_days

Data type: Optional[Integer]

expire time in days; defaults to 7; value of 0 means never purge

ssh::parse_ssh_pubkey

Type: Puppet Language

Taka an ssh pugkey that looks like: ssh-rsa jdlkfgjsdfo;i... user@domain.com and turn it into a hash, usable in the ssh_authorized_key type

ssh::parse_ssh_pubkey(String $key)

Taka an ssh pugkey that looks like: ssh-rsa jdlkfgjsdfo;i... user@domain.com and turn it into a hash, usable in the ssh_authorized_key type

Returns: Hash

key

Data type: String

The ssh key, can be pasted from ~/.ssh/id_rsa.pub or similar

ssh_autokey

Type: Ruby 3.x API

Keys are stored in "Puppet[:vardir]/simp/environments//simp_autofiles/ssh_autokeys"

Arguments: username, [option_hash|integer], [return_private]

  • If an integer is the second argument, it will be used as the key strength

  • If a third option is passed AND the second option is not a Hash, the function will return the private key

  • option_hash

    • If option_hash is passed (as a Hash) then the following options are supported:
      • 'key_strength' => Integer
      • 'return_private' => Boolean (Anything but false|nil will be treated as 'true')

    NOTE: A minimum key strength of 1024 will be enforc

ssh_autokey()

Keys are stored in "Puppet[:vardir]/simp/environments//simp_autofiles/ssh_autokeys"

Arguments: username, [option_hash|integer], [return_private]

  • If an integer is the second argument, it will be used as the key strength

  • If a third option is passed AND the second option is not a Hash, the function will return the private key

  • option_hash

    • If option_hash is passed (as a Hash) then the following options are supported:
      • 'key_strength' => Integer
      • 'return_private' => Boolean (Anything but false|nil will be treated as 'true')

    NOTE: A minimum key strength of 1024 will be enforc

Returns: String The public cert of the passed user or the private key if requested.

ssh_global_known_hosts

Type: Ruby 3.x API

This function updates the ssh_known_hosts file for all hosts and updates any new ones that are found.

This function takes one argument, expire time which is specified in days.

Default expire time is 7 days. Set to '0' to never p

ssh_global_known_hosts()

This function updates the ssh_known_hosts file for all hosts and updates any new ones that are found.

This function takes one argument, expire time which is specified in days.

Default expire time is 7 days. Set to '0' to never p

Returns: None