Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
chef-ssh-hardening — This chef cookbook provides secure ssh-client and ssh-server configurations. | Kitploit
Tools/GitHubGitHub/dev-sec/chef-ssh-hardening
Cloud Infrastructure SecurityConfiguration AuditingNetwork SecurityDevSecOpsAuthentication
GitHubdev-sec/chef-ssh-hardening

chef-ssh-hardening

This chef cookbook provides secure ssh-client and ssh-server configurations.

View Repository
16866505 days agoReviewed by Kitploit

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Website
Share

ssh-hardening (Chef cookbook)

[Supermarket][1] [Build Status][2] [Code Coverage][3] [Gitter Chat][4]

Description

This cookbook provides secure ssh-client and ssh-server configurations. This cookbook does not provide capabilities for management of users and/or ssh keys, please use other cookbooks for that.

Requirements

  • Chef >= 14.13.11

Platform

  • Debian 8, 9, 10
  • Ubuntu 16.04, 18.04
  • RHEL 6, 7
  • CentOS 6, 7
  • Oracle Linux 6, 7
  • Fedora 29, 30
  • OpenSuse Leap 42
  • Amazon Linux 1, 2

Attributes

Below you can find the attribute documentation and their default values.

Notice: Some of attribute defaults of this cookbook are set in the recipes. You should use a higher attribute precedence level for overriding of such attributes. Such attributes are flagged with #override attribute# in the list below. Example for overriding a such attribute:

override['ssh-hardening']['ssh']['server']['listen_to'] = node['ipaddress']
  • ['ssh-hardening']['network']['ipv6']['enable'] - false. Set to true if IPv6 is needed
  • ['ssh-hardening']['ssh']['ports'] - 22. Ports to which ssh-server should listen to and ssh-client should connect to
  • ['ssh-hardening']['ssh'][{'client', 'server'}]['kex'] - nil to calculate best key-exchange (KEX) based on server version, otherwise specify a string of Kex values
  • ['ssh-hardening']['ssh'][{'client', 'server'}]['mac'] - nil to calculate best Message Authentication Codes (MACs) based on server version, otherwise specify a string of Mac values
  • ['ssh-hardening']['ssh'][{'client', 'server'}]['cipher'] - nil to calculate best ciphers based on server version, otherwise specify a string of Cipher values
  • ['ssh-hardening']['ssh'][{'client', 'server'}]['cbc_required'] - false. Set to true if CBC for ciphers is required. This is usually only necessary, if older M2M mechanism need to communicate with SSH, that don't have any of the configured secure ciphers enabled. CBC is a weak alternative. Anything weaker should be avoided and is thus not available.
  • ['ssh-hardening']['ssh'][{'client', 'server'}]['weak_hmac'] - false. Set to true if weaker HMAC mechanisms are required. This is usually only necessary, if older M2M mechanism need to communicate with SSH, that don't have any of the configured secure HMACs enabled.
  • ['ssh-hardening']['ssh'][{'client', 'server'}]['weak_kex'] - false. Set to true if weaker Key-Exchange (KEX) mechanisms are required. This is usually only necessary, if older M2M mechanism need to communicate with SSH, that don't have any of the configured secure KEXs enabled.
  • ['ssh-hardening']['ssh']['client']['remote_hosts'] - [] - one or more hosts, to which ssh-client can connect to.
  • ['ssh-hardening']['ssh']['client']['password_authentication'] - false. Set to true if password authentication should be enabled.
  • ['ssh-hardening']['ssh']['client']['roaming'] - false. Set to true if experimental client roaming should be enabled. This is known to cause potential issues with secrets being disclosed to malicious servers and defaults to being disabled.
  • ['ssh-hardening']['ssh']['client']['extras'] - {}. Add extra configuration options, see below for details
  • ['ssh-hardening']['ssh']['server']['host_key_files'] - nil to calculate best hostkey configuration based on server version, otherwise specify an array with file paths (e.g. /etc/ssh/ssh_host_rsa_key)
  • ['ssh-hardening']['ssh']['server']['dh_min_prime_size'] - 2048 - Minimal acceptable prime length in bits in /etc/ssh/moduli. Primes below this number will get removed. (See this for more information and background)
  • ['ssh-hardening']['ssh']['server']['dh_build_primes'] - false - If own primes should be built. This rebuild happens only once and takes a lot of time (~ 1.5 - 2h on the modern hardware for 4096 length).
  • ['ssh-hardening']['ssh']['server']['dh_build_primes_size'] - 4096 - Prime length which should be generated. This option is only valid if dh_build_primes is enabled.
  • ['ssh-hardening']['ssh']['server']['listen_to'] #override attribute# - one or more ip addresses, to which ssh-server should listen to. Default is to listen on all interfaces. It should be configured for security reasons!
  • ['ssh-hardening']['ssh']['server']['allow_root_with_key'] - false to disable root login altogether. Set to true to allow root to login via key-based mechanism
  • ['ssh-hardening']['ssh']['server']['allow_tcp_forwarding'] - false. Set to true to allow TCP Forwarding
  • ['ssh-hardening']['ssh']['server']['allow_agent_forwarding'] - false. Set to true to allow Agent Forwarding
  • ['ssh-hardening']['ssh']['server']['allow_x11_forwarding'] - false. Set to true to allow X11 Forwarding
  • ['ssh-hardening']['ssh']['server']['permit_tunnel'] - false to disable tun device forwarding. Set to true to allow tun device forwarding. Other accepted values: 'yes', 'no', 'point-to-point', 'ethernet'. See man sshd_config for exact behaviors. Note: you'll also need to enable allow_tcp_forwarding.
  • ['ssh-hardening']['ssh']['server']['use_pam'] - true. Set to false to disable the pam authentication of sshd
  • ['ssh-hardening']['ssh']['server']['challenge_response_authentication'] - false. Set to true to enable challenge response authentication.
  • ['ssh-hardening']['ssh']['server']['deny_users'] - [] to configure DenyUsers, if specified login is disallowed for user names that match one of the patterns.
  • ['ssh-hardening']['ssh']['server']['allow_users'] - [] to configure AllowUsers, if specified, login is allowed only for user names that match one of the patterns.
  • ['ssh-hardening']['ssh']['server']['deny_groups'] - [] to configure DenyGroups, if specified, login is disallowed for users whose primary group or supplementary group list matches one of the patterns.
  • ['ssh-hardening']['ssh']['server']['allow_groups'] - [] to configure AllowGroups, if specified, login is allowed only for users whose primary group or supplementary group list matches one of the patterns.
  • ['ssh-hardening']['ssh']['server']['print_motd'] - false. Set to true to enable printing of the MOTD
  • ['ssh-hardening']['ssh']['server']['print_last_log'] - false. Set to true to enable printing of last login information
  • ['ssh-hardening']['ssh']['server']['banner'] - nil. Set a path like '/etc/issue.net' to enable the banner
  • ['ssh-hardening']['ssh']['server']['os_banner'] - false to disable version information during the protocol handshake (debian family only). Set to true to enable it
  • ['ssh-hardening']['ssh']['server']['use_dns'] - nil to use the openssh default. Set to true or false to enable/disable the DNS lookup and check of remote host
  • ['ssh-hardening']['ssh']['server']['use_privilege_separation'] - nil to calculate the best value based on server version, otherwise set true or false
  • ['ssh-hardening']['ssh']['server']['login_grace_time'] - 30s. Time in which the login should be successfully, otherwise the user is disconnected.
  • ['ssh-hardening']['ssh']['server']['max_auth_tries'] - 2. The number of authentication attempts per connection
  • ['ssh-hardening']['ssh']['server']['max_sessions'] - 10 The number of sessions per connection
  • ['ssh-hardening']['ssh']['server']['password_authentication'] - false. Set to true if password authentication should be enabled
  • ['ssh-hardening']['ssh']['server']['log_level'] - verbose. The log level of sshd. See LogLevel in man 5 sshd_config for possible values.
Download Tool