From 84215f502b5c6a7e516a44a69fb9e45676e86d2a Mon Sep 17 00:00:00 2001 From: root Date: Thu, 25 Jan 2024 09:53:12 +0100 Subject: [PATCH] generate cle publique et privee --- goss.yaml | 25 +++++++++++++++++++++++++ roles/ssh-backup-key-gen/README.md | 1 + roles/ssh-backup-key-gen/tasks/main.yml | 20 ++++++++++++++++++++ s-adm.yml | 1 + 4 files changed, 47 insertions(+) create mode 100644 goss.yaml create mode 100644 roles/ssh-backup-key-gen/README.md create mode 100644 roles/ssh-backup-key-gen/tasks/main.yml diff --git a/goss.yaml b/goss.yaml new file mode 100644 index 0000000..aded50e --- /dev/null +++ b/goss.yaml @@ -0,0 +1,25 @@ +port: + tcp:22: + listening: true + ip: + - 0.0.0.0 + tcp6:22: + listening: true + ip: + - '::' +service: + sshd: + enabled: true + running: true +user: + sshd: + exists: true + uid: 101 + gid: 65534 + groups: + - nogroup + home: /run/sshd + shell: /usr/sbin/nologin +process: + sshd: + running: true diff --git a/roles/ssh-backup-key-gen/README.md b/roles/ssh-backup-key-gen/README.md new file mode 100644 index 0000000..28b1be1 --- /dev/null +++ b/roles/ssh-backup-key-gen/README.md @@ -0,0 +1 @@ +###Génération de clé publique et privée### diff --git a/roles/ssh-backup-key-gen/tasks/main.yml b/roles/ssh-backup-key-gen/tasks/main.yml new file mode 100644 index 0000000..f65e196 --- /dev/null +++ b/roles/ssh-backup-key-gen/tasks/main.yml @@ -0,0 +1,20 @@ +--- +- name: on genere une cle privee pour s-backup + openssh_keypair: + path: /root/id_rsa_sbackup + type: rsa + state: present + +- name: copie cle publique dans gsbstore + copy: + src: /root/id_rsa_sbackup.pub + dest: /var/www/html/gsbstore + mode: 0644 + remote_src: yes + +- name: copie cle privee dans gsbstore + copy: + src: /root/id_rsa_sbackup + dest: /var/www/html/gsbstore + mode: 0600 + remote_src: yes diff --git a/s-adm.yml b/s-adm.yml index af198f1..7d8c179 100644 --- a/s-adm.yml +++ b/s-adm.yml @@ -7,6 +7,7 @@ - s-ssh - dnsmasq - squid + - ssh-backup-key-gen # - local-store - zabbix-cli ## - syslog-cli