You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

преди 11 години
123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. ---
  2. - hosts: all
  3. vars:
  4. conf: /etc/ssh/sshd_config
  5. sudo: yes
  6. tasks:
  7. - name: Protocol 2
  8. lineinfile: dest={{conf}}
  9. regexp="^(#)?Protocol"
  10. line="Protocol 2"
  11. notify: restart sshd
  12. - name: PermitRootLogin no
  13. lineinfile: dest={{conf}}
  14. regexp="^(#)?PermitRootLogin"
  15. line="PermitRootLogin no"
  16. notify: restart sshd
  17. - name: RSAAuthentication no
  18. lineinfile: dest={{conf}}
  19. regexp="^(#)?RSAAuthentication"
  20. line="RSAAuthentication no"
  21. notify: restart sshd
  22. - name: PasswordAuthentication no
  23. lineinfile: dest={{conf}}
  24. regexp="^(#)?PasswordAuthentication"
  25. line="PasswordAuthentication no"
  26. notify: restart sshd
  27. - name: PermitEmptyPassword no
  28. lineinfile: dest={{conf}}
  29. regexp="^(#)?PermitEmptyPasswords"
  30. line="PermitEmptyPasswords no"
  31. notify: restart sshd
  32. - name: ChallengeResponseAuthentication no
  33. lineinfile: dest={{conf}}
  34. regexp="^(#)?ChallengeResponseAuthentication"
  35. line="ChallengeResponseAuthentication no"
  36. notify: restart sshd
  37. - name: UseDNS no
  38. lineinfile: dest={{conf}}
  39. regexp="^(#)?UseDNS"
  40. line="UseDNS no"
  41. notify: restart sshd
  42. handlers:
  43. - name: restart sshd
  44. service: name=ssh state=restarted