You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 26, 2020. It is now read-only.
- Don't overwrite ssh\_host\_key\_files if set manually [\#125](https://github.com/dev-sec/ansible-ssh-hardening/pull/125) ([oakey-b1](https://github.com/oakey-b1))
14
+
- Add comment filter to {{ansible\_managed}} string [\#121](https://github.com/dev-sec/ansible-ssh-hardening/pull/121) ([fazlearefin](https://github.com/fazlearefin))
- bugfix. Now option true for PrintLastLog is available again [\#39](https://github.com/dev-sec/ansible-ssh-hardening/pull/39) ([fitz123](https://github.com/fitz123))
205
218
- Add more travis-tests [\#38](https://github.com/dev-sec/ansible-ssh-hardening/pull/38) ([rndmh3ro](https://github.com/rndmh3ro))
206
219
- Support for selinux and pam. fix \#23 [\#35](https://github.com/dev-sec/ansible-ssh-hardening/pull/35) ([rndmh3ro](https://github.com/rndmh3ro))
Copy file name to clipboardExpand all lines: README.md
+13-1Lines changed: 13 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ Warning: This role disables root-login on the target server! Please make sure yo
27
27
|`ssh_server_ports`|['22']|ports on which ssh-server should listen|
28
28
|`ssh_client_port`| '22' |port to which ssh-client should connect|
29
29
|`ssh_listen_to`|['0.0.0.0']|one or more ip addresses, to which ssh-server should listen to. Default is all adresseses, but should be configured to specific addresses for security reasons!|
30
-
|`ssh_host_key_files`|['/etc/ssh/ssh_host_rsa_key', '/etc/ssh/ssh_host_dsa_key', '/etc/ssh/ssh_host_ecdsa_key']|Host keys to look for when starting sshd.|
30
+
|`ssh_host_key_files`|[]|Host keys for sshd. If empty ['/etc/ssh/ssh_host_rsa_key', '/etc/ssh/ssh_host_ecdsa_key', '/etc/ssh/ssh_host_ed25519_key']will be used, as far as supported by the installed sshd version|
31
31
|`ssh_client_alive_interval`| 600 | specifies an interval for sending keepalive messages |
32
32
|`ssh_client_alive_count`| 3 | defines how often keep-alive messages are sent |
33
33
|`ssh_permit_tunnel`| false | true if SSH Port Tunneling is required |
@@ -50,6 +50,18 @@ Warning: This role disables root-login on the target server! Please make sure yo
50
50
|`ssh_client_password_login`| false |`true` to allow password-based authentication with the ssh client |
51
51
|`ssh_server_password_login`| false |`true` to allow password-based authentication with the ssh server |
52
52
|`ssh_google_auth`| false |`true` to enable google authenticator based TOTP 2FA |
53
+
|`ssh_banner`|`false`|`true` to print a banner on login |
54
+
|`ssh_client_hardening`|`true`|`false` to stop harden the client |
55
+
|`ssh_client_port`|`'22'`| Specifies the port number to connect on the remote host. |
56
+
|`ssh_compression`|`false`| Specifies whether compression is enabled after the user has authenticated successfully. |
57
+
|`ssh_max_auth_retries`|`2`| Specifies the maximum number of authentication attempts permitted per connection. |
58
+
|`ssh_print_debian_banner`|`false`|`true` to print debian specific banner |
59
+
|`ssh_server_enabled`|`true`|`false` to disable the opensshd server |
60
+
|`ssh_server_hardening`|`true`|`false` to stop harden the server |
61
+
|`ssh_server_match_group`| '' | Introduces a conditional block. If all of the criteria on the Match line are satisfied, the keywords on the following lines override those set in the global section of the config file, until either another Match line or the end of the file. |
62
+
|`ssh_server_match_user`| '' | Introduces a conditional block. If all of the criteria on the Match line are satisfied, the keywords on the following lines override those set in the global section of the config file, until either another Match line or the end of the file. |
63
+
|`ssh_server_permit_environment_vars`|`false`|`true` to specify that ~/.ssh/environment and environment= options in ~/.ssh/authorized_keys are processed by sshd |
64
+
|`ssh_use_dns`|`false`| Specifies whether sshd should look up the remote host name, and to check that the resolved host name for the remote IP address maps back to the very same IP address. |
53
65
|`ssh_server_revoked_keys`|[]| a list of revoked public keys that the ssh server will always reject, useful to revoke known weak or compromised keys.|
# Specifies the maximum number of authentication attempts permitted per connection. Once the number of failures reaches half this value, additional failures are logged.
37
46
ssh_max_auth_retries: 2
@@ -99,6 +108,14 @@ sftp_chroot_dir: /home/%u
99
108
# enable experimental client roaming
100
109
ssh_client_roaming: false
101
110
111
+
# list of hashes (containing user and rules) to generate Match User blocks for.
112
+
ssh_server_match_user: false # sshd
113
+
114
+
# list of hashes (containing group and rules) to generate Match Group blocks for.
Copy file name to clipboardExpand all lines: templates/opensshd.conf.j2
+55-19Lines changed: 55 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -7,15 +7,15 @@
7
7
# ===================
8
8
9
9
# Either disable or only allowssh root login via certificates.
10
-
PermitRootLogin {{ 'without-password' if ssh_allow_root_with_key else 'no' }}
10
+
PermitRootLogin {{ 'without-password' if (ssh_allow_root_with_key|bool) else 'no' }}
11
11
12
12
# Define which port sshd should listen to. Default to `22`.
13
13
{%forportinssh_server_ports -%}
14
14
Port {{port}}
15
15
{%endfor%}
16
16
17
17
# Address family should always be limited to the active network configuration.
18
-
AddressFamily {{ 'any' if network_ipv6_enable else 'inet' }}
18
+
AddressFamily {{ 'any' if (network_ipv6_enable|bool) else 'inet' }}
19
19
20
20
# Define which addresses sshd should listen to. Default to `0.0.0.0`, ie make sure you put your desired address in here, since otherwise sshd will listen to everyone.
0 commit comments