sshd.yml 609 B

1234567891011121314151617181920212223242526
  1. - name: sshd yaml
  2. hosts: all
  3. become: true
  4. gather_facts: false
  5. tasks:
  6. - name: sshd is installed
  7. yum:
  8. name: openssh-server
  9. state: latest
  10. - name: sshd is enabled and started
  11. service:
  12. name: sshd
  13. state: started
  14. enabled: yes
  15. - name: banner
  16. lineinfile:
  17. path: /etc/ssh/sshd_config
  18. line: 'Banner /etc/motd'
  19. - name: X11Fordw
  20. lineinfile:
  21. path: /etc/ssh/sshd_config
  22. line: 'X11Forwarding yes'
  23. - name: MaxAuthTries
  24. lineinfile:
  25. path: /etc/ssh/sshd_config
  26. line: 'MaxAuthTries 3'