sshd.yml 765 B

12345678910111213141516171819202122232425262728293031
  1. - name: Disable dns for sshd
  2. become: true
  3. ansible.builtin.lineinfile:
  4. path: /etc/ssh/sshd_config
  5. regexp: "^UseDNS "
  6. line: UseDNS no
  7. backup: true
  8. - name: Disable GSS api auth for sshd
  9. become: true
  10. ansible.builtin.lineinfile:
  11. path: /etc/ssh/sshd_config
  12. regexp: "^GSSAPIAuthentication "
  13. line: GSSAPIAuthentication no
  14. backup: true
  15. - name: Disable root ssh login
  16. become: true
  17. ansible.builtin.lineinfile:
  18. path: /etc/ssh/sshd_config
  19. regexp: "^PermitRootLogin no"
  20. line: PermitRootLogin no
  21. backup: true
  22. - name: Disable ssh login by password
  23. become: true
  24. ansible.builtin.lineinfile:
  25. path: /etc/ssh/sshd_config
  26. regexp: "^PasswordAuthentication no"
  27. line: PasswordAuthentication no
  28. backup: true