Puppet Class: almalinux_hardening::services::ssh::max_sessions

Inherits:
almalinux_hardening::services::ssh::service
Defined in:
manifests/services/ssh/max_sessions.pp

Summary

Set SSH MaxSessions limit

Overview

Puppet Module to perform AlmaLinux 8 OS Hardening with CIS benchmark. Copyright © 2022 Jonas Hügli

Examples:

include almalinux_hardening::services::ssh::max_sessions


20
21
22
23
24
25
26
27
28
29
30
# File 'manifests/services/ssh/max_sessions.pp', line 20

class almalinux_hardening::services::ssh::max_sessions inherits almalinux_hardening::services::ssh::service {
  if $almalinux_hardening::enable_ssh_max_sessions {
    file_line { 'ssh_max_sessions':
      ensure => 'present',
      path   => '/etc/ssh/sshd_config',
      line   => "MaxSessions ${almalinux_hardening::ssh_max_sessions}",
      match  => '^(#|).*MaxSessions.*.[0-9]*.*$',
    }
    ~> Service['sshd']
  }
}