jborean93 / ansible-role-win_openssh

Ansible Role to install Win32-OpenSSH on Windows - https://github.com/PowerShell/Win32-OpenSSH
MIT License
28 stars 17 forks source link

opt_openssh_shared_admin_key: true 2nd run problem #12

Open gamethis opened 3 years ago

gamethis commented 3 years ago

when running 2nd time with opt_openssh_shared_admin_key: true

the following lines in c:\programdata\ssh\sshd_config and in the c:\program files\Openssh\sshd_config_defaults:

Match Group administrators
       AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys

get changed to :

Match Group administrators

this causes authorized keys in the administrators_authorized_keys file to be ignored.

jborean93 commented 3 years ago

I cannot replicate this, I've created a test playbook that did the various permutations on 2 runs of the role; True -> False, True -> True, False -> True, and False -> False and they all acted as expected. Both lines were present when opt_openssh_shared_admin_key: True and only the Match Group administrators line is set when opt_openssh_shared_admin_key: False which is the expected behaviour. Are you sure you set the variable to True in the 2nd run?