Adding option for secondary user to receive public keys
This commit is contained in:
parent
1cfe858e74
commit
c1656f82ec
3 changed files with 15 additions and 0 deletions
|
@ -53,6 +53,9 @@ base_core_root_ca_url: ""
|
|||
# SSH
|
||||
# ===
|
||||
|
||||
# Added the public keys to an additional user if defined
|
||||
base_core_ssh_public_keys_user: ""
|
||||
|
||||
# Allow ssh root login
|
||||
base_core_ssh_permit_root_login: false
|
||||
|
||||
|
|
|
@ -28,6 +28,17 @@
|
|||
tags:
|
||||
- authorized_key
|
||||
|
||||
- name: Setup authorized keys for secondary user
|
||||
authorized_key:
|
||||
user: "{{ base_core_ssh_public_keys_user }}"
|
||||
state: present
|
||||
key: '{{ lookup("file", item) }}'
|
||||
with_fileglob:
|
||||
- "public_keys/*"
|
||||
when: base_core_ssh_public_keys_user != ""
|
||||
tags:
|
||||
- authorized_key
|
||||
|
||||
- name: Configure SSH root login
|
||||
lineinfile:
|
||||
path: /etc/ssh/sshd_config
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue