|
232 | 232 | - 'delphix'
|
233 | 233 | - 'root'
|
234 | 234 |
|
235 |
| -# |
236 |
| -# The 'ClientAliveInterval' setting determines the amount of time |
237 |
| -# (in seconds) the sshd server will wait to receive data from the |
238 |
| -# client before sending a request for response. |
239 |
| -# |
240 |
| -- set_fact: |
241 |
| - ssh_client_alive_interval: "300" |
242 |
| - ssh_client_alive_count_max: "3" |
243 |
| - |
244 |
| -# |
245 |
| -# With that said (see comment above), the Azure marketplace does not |
246 |
| -# allow a value greater than 3 minutes. So, when running on Azure, we |
247 |
| -# use 3 minutes. |
248 |
| -# |
249 |
| -- set_fact: |
250 |
| - ssh_client_alive_interval: "180" |
251 |
| - ssh_client_alive_count_max: "0" |
252 |
| - when: |
253 |
| - - platform == "azure" |
254 |
| - |
255 |
| -- lineinfile: |
256 |
| - path: /etc/ssh/sshd_config |
257 |
| - regexp: "^#?{{ item.key }} " |
258 |
| - line: "{{ item.key }} {{ item.value }}" |
259 |
| - with_items: |
260 |
| - # |
261 |
| - # Configure SSH to allow PAM "conversations" (interactions with the user). |
262 |
| - # |
263 |
| - - { key: "ChallengeResponseAuthentication", value: "yes" } |
264 |
| - # |
265 |
| - # Harden the appliance by disabling ssh-agent(1), tcp, UNIX domain, and |
266 |
| - # X11 forwarding. Note that this doesn't improve security unless users are |
267 |
| - # also denied shell access. |
268 |
| - # |
269 |
| - - { key: "AllowAgentForwarding", value: "no" } |
270 |
| - - { key: "AllowStreamLocalForwarding", value: "no" } |
271 |
| - - { key: "AllowTcpForwarding", value: "no" } |
272 |
| - - { key: "Ciphers", value: "[email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]" } |
273 |
| - - { key: "ClientAliveCountMax", value: "{{ ssh_client_alive_count_max }}" } |
274 |
| - - { key: "ClientAliveInterval", value: "{{ ssh_client_alive_interval }}" } |
275 |
| - - { key: "HostKeyAlgorithms", value: "-ssh-rsa*" } |
276 |
| - - { key: "KexAlgorithms", value: "curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256"} |
277 |
| - - { key: "LoginGraceTime", value: "60"} |
278 |
| - |
279 |
| - - { key: "MaxAuthTries", value: "4" } |
280 |
| - - { key: "MaxStartups", value: "10:30:60"} |
281 |
| - - { key: "PermitRootLogin", value: "no" } |
282 |
| - - { key: "X11Forwarding", value: "no" } |
283 |
| - notify: "sshd config changed" |
284 |
| - |
285 | 235 | - blockinfile:
|
286 | 236 | path: /etc/profile
|
287 | 237 | insertafter: EOF
|
|
318 | 268 | # like last-login, "welcome to ubuntu", and help messages. This makes linux and
|
319 | 269 | # illumos look the same, too.
|
320 | 270 | #
|
321 |
| -- replace: |
322 |
| - dest: /etc/ssh/sshd_config |
323 |
| - regexp: '^#?[\s]*PrintLastLog.*$' |
324 |
| - replace: 'PrintLastLog no' |
325 | 271 | - replace:
|
326 | 272 | dest: /etc/pam.d/sshd
|
327 | 273 | regexp: '^(session[\s]+optional[\s]+pam_motd\.so.*)$'
|
|
0 commit comments