Use AuthorizedKeysCommand to make it more dynamic
Replace the manual update of authorized key by a script. That should should be plugged as AuthorizedKeysCommand
into sshd config.
That will simplify the code and will also make the deployed very simple.
Technically, we need to update the sshd config file during installation or configuration.
Match User minarca
PubkeyAuthentication yes
PasswordAuthentication no
AllowGroups minarca
X11Forwarding no
AllowTcpForwarding no
PermitTTY no
AuthorizedKeysCommand ...
AuthorizedKeysCommandRunAs minarca
ForceCommand ...
Edited by Patrik Dufresne