mirror of
https://github.com/trailofbits/algo.git
synced 2025-06-06 15:13:56 +02:00
SSH fingerprints #77
This commit is contained in:
parent
0945f54366
commit
57b6c96ba8
2 changed files with 16 additions and 0 deletions
|
@ -30,7 +30,20 @@
|
|||
group: "{{ item }}"
|
||||
state: link
|
||||
with_items: "{{ users }}"
|
||||
|
||||
- name: Generate SSH fingerprints
|
||||
shell: >
|
||||
ssh-keyscan {{ IP_subject_alt_name }} 2>/dev/null
|
||||
register: ssh_fingerprints
|
||||
|
||||
- name: The known_hosts file created
|
||||
template: src=known_hosts.j2 dest=/root/.ssh/{{ IP_subject_alt_name }}_known_hosts
|
||||
|
||||
- name: Fetch users SSH private keys
|
||||
fetch: src='/var/jail/{{ item }}/.ssh/id_rsa' dest=configs/{{ IP_subject_alt_name }}_{{ item }}.ssh.pem flat=yes
|
||||
with_items: "{{ users }}"
|
||||
|
||||
- name: Fetch the known_hosts file
|
||||
fetch: src='/root/.ssh/{{ IP_subject_alt_name }}_known_hosts' dest=configs/{{ IP_subject_alt_name }}_known_hosts flat=yes
|
||||
|
||||
|
||||
|
|
3
roles/ssh_tunneling/templates/known_hosts.j2
Normal file
3
roles/ssh_tunneling/templates/known_hosts.j2
Normal file
|
@ -0,0 +1,3 @@
|
|||
{% for item in ssh_fingerprints.stdout_lines %}
|
||||
{{ item }}
|
||||
{% endfor %}
|
Loading…
Add table
Reference in a new issue