Skip to content

Instantly share code, notes, and snippets.

@huangyg11
Created September 30, 2015 06:30
Show Gist options
  • Save huangyg11/7c19d7b364c46becba4b to your computer and use it in GitHub Desktop.
Save huangyg11/7c19d7b364c46becba4b to your computer and use it in GitHub Desktop.
ansible playbook. disable ssh key auth
- hosts: all
tasks:
- name: disable ssh key auth
lineinfile:
dest: /etc/ssh/sshd_config
regexp: ^PasswordAuthentication
line: PasswordAuthentication no
notify:
restart ssh
handlers:
- name: restart ssh
service:
name: sshd
state: restarted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment