Skip to content

Instantly share code, notes, and snippets.

@NetguruGist
Created February 14, 2017 10:04
Show Gist options
  • Save NetguruGist/a516c4ddda9eebf0da7ae2e51cf7b5c4 to your computer and use it in GitHub Desktop.
Save NetguruGist/a516c4ddda9eebf0da7ae2e51cf7b5c4 to your computer and use it in GitHub Desktop.
- name: "Enforce ssh key logins"
action: lineinfile dest=/etc/ssh/sshd_config regexp="^PermitRootLogin" line="PermitRootLogin no" state=present
notify: Restart ssh
- action: lineinfile dest=/etc/ssh/sshd_config regexp="^PasswordAuthentication" line="PasswordAuthentication no" state=present
notify: Restart ssh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment