-
Notifications
You must be signed in to change notification settings - Fork 89
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
Different modes for private/public keys with openssh_keypair
#632
Comments
Afair |
Agreed. The breaking change may annoy some people though. Maybe a compromise:
(And if you want, you could mark |
It's not so simple to remove You can certainly keep I don't have a strong opinion about what the best interface for this is, but given this is cryptographic material we should be as safe as possible at the time of creation. |
The follow-up task workaround would create idempotence issues. However, I'm not so sure about the initial statement here:
By default, private keys are set to
|
Correct, using the follow-up task would trigger a change on every run. And yes by default not setting mode will result in I think the only case where you would want to set Setting the private key less restrictive historically would cause issues with |
Sorry I'm not an insider, so some of this went over my head. Are you saying that my problem is that I actually used |
Yes... just tested it. The trick is NOT to set mode to begin with. :-) Thanks. It would probably help others if the the docs had a one liner on this. |
I tried to do a PR to add that to the docs, but for reasons I don't understand, UPDATE: Aah, it's a template. Well I'm not a python dev, so can't really help here! 😄 |
This is already in there:
But yes, it might also help to document explicitly that by default 600/644 permissions will be applied. The documentation for Edit: Here:
|
You are right! Sorry, missed that. I always look into the corresponding parameter row in the table. |
Nah, it is kinda unintuitive sometimes. Thanks for helping out and working on a solution! :-) |
SUMMARY
The
openssh_keypair
sets the same mode for both private and public keys.So
mode: '0600'
will set that mode for both keys. Typically the private key has600
and the public has644
(if not, then ssh won't read it, so I need to add another task to fix the permissions).ISSUE TYPE
Another attribute, e.g.
mode_public
, which sets the mode just for the public key.COMPONENT NAME
openssh_keypair
ADDITIONAL INFORMATION
As above.
The text was updated successfully, but these errors were encountered: