Skip to content

Instantly share code, notes, and snippets.

@yaxinr
Created April 10, 2019 20:26
Show Gist options
  • Save yaxinr/f8de74df4ced09f289876c1be5c9c18d to your computer and use it in GitHub Desktop.
Save yaxinr/f8de74df4ced09f289876c1be5c9c18d to your computer and use it in GitHub Desktop.
ssh-keygen
- hosts: all
become: true
gather_facts: false
tasks:
- name: Generate /etc/ssh/ RSA host key
command : ssh-keygen -q -t rsa -f /etc/ssh/ssh_host_rsa_key -C "" -N ""
args:
creates: /etc/ssh/ssh_host_rsa_key
- name: Generate /etc/ssh/ DSA host key
command : ssh-keygen -q -t dsa -f /etc/ssh/ssh_host_dsa_key -C "" -N ""
args:
creates: /etc/ssh/ssh_host_dsa_key
- name: Generate /etc/ssh/ ECDSA host key
command : ssh-keygen -q -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -C "" -N ""
args:
creates: /etc/ssh/ssh_host_ecdsa_key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment