Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exclusive + pubkey list results in only last key being added #7

Open
abeluck opened this issue Sep 2, 2020 · 1 comment
Open

exclusive + pubkey list results in only last key being added #7

abeluck opened this issue Sep 2, 2020 · 1 comment

Comments

@abeluck
Copy link

abeluck commented Sep 2, 2020

When you specify a list of pubkeys for a single user:

      - username: admin
        exclusive: true
        pubkey:
          - "ssh-rsa ..."
          - "ssh-dsa ..."

only the final key is kept, the others are discarded.

As per the authorized_key docs

Multiple keys can be specified in a single key string value by separating them by newlines.
This option is not loop aware, so if you use with_ , it will be exclusive per iteration of the loop.
If you want multiple keys in the file you need to pass them all to key in a single batch as mentioned above.

(emphasis added)

Locked myself out of a couple of dev machines 😢

@abeluck abeluck changed the title exclusive + pubkey list fails exclusive + pubkey list results in only last key being added Sep 2, 2020
@cchurch
Copy link
Owner

cchurch commented Sep 7, 2020

Thanks, I'll take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants