Browse Source

Exercise 3: Add missing SSH part in SLS code

master
Pekka Helenius 6 years ago
committed by GitHub
parent
commit
5893bcd1f3
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      h3.md

+ 7
- 1
h3.md View File

@ -420,11 +420,17 @@ check_sshd_config:
- require:
- pkg: check_sshd_install
prevent_if_ssh_sessions_open:
cmd.run:
- name: 'if [ $(/bin/netstat -tnpa | grep "ESTABLISHED.*sshd" | wc -l) -gt 0 ]; then false; fi'
- require:
- file: check_sshd_config
ssh_port:
cmd.run:
- name: 'sed -i -r "s/^[#P]+ort [0-9][0-9]*/Port {{ supersecret_ssh_port }}/" /etc/ssh/sshd_config'
- require:
- file: check_sshd_config
- cmd: prevent_if_ssh_sessions_open
sshd_restart:
service.running:


Loading…
Cancel
Save