소스 검색

ansible: add sshd_config.yml

pull/1/head
10sr 10 년 전
부모
커밋
ecca55a1d5
1개의 변경된 파일45개의 추가작업 그리고 0개의 파일을 삭제
  1. +45
    -0
      ansible/sshd_config.yml

+ 45
- 0
ansible/sshd_config.yml 파일 보기

@@ -0,0 +1,45 @@
---
- hosts: all
vars:
conf: /etc/ssh/sshd_config
sudo: yes
tasks:
- name: Protocol 2
lineinfile: dest={{conf}}
regexp="^(#)?Protocol"
line="Protocol 2"
notify: restart sshd
- name: PermitRootLogin no
lineinfile: dest={{conf}}
regexp="^(#)?PermitRootLogin"
line="PermitRootLogin no"
notify: restart sshd
- name: RSAAuthentication no
lineinfile: dest={{conf}}
regexp="^(#)?RSAAuthentication"
line="RSAAuthentication no"
notify: restart sshd
- name: PasswordAuthentication no
lineinfile: dest={{conf}}
regexp="^(#)?PasswordAuthentication"
line="PasswordAuthentication no"
notify: restart sshd
- name: PermitEmptyPassword no
lineinfile: dest={{conf}}
regexp="^(#)?PermitEmptyPasswords"
line="PermitEmptyPasswords no"
notify: restart sshd
- name: ChallengeResponseAuthentication no
lineinfile: dest={{conf}}
regexp="^(#)?ChallengeResponseAuthentication"
line="ChallengeResponseAuthentication no"
notify: restart sshd
- name: UseDNS no
lineinfile: dest={{conf}}
regexp="^(#)?UseDNS"
line="UseDNS no"
notify: restart sshd

handlers:
- name: restart sshd
service: name=ssh state=restarted

불러오는 중...
취소
저장