-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
ssh module comment/spaces modifications #987
Comments
What was wrong with the old way + adding an error to the return when a key has a space? |
That's what I'm suggesting. Except we should keep the new |
I don't think an exception is the right way to go here, I think that we should still try to support spaces in the key. Since we can cut up an existing key we should be able to cut up a key passed in, and if it does not fit the bill then return a failure so the state can handle it. Also, we don't want to return exceptions back to the cli when calling a module |
I don't believe spaces are valid characters in an ssh key, according to the authorized_keys manpage spaces are only allowed in double quotes in the options before a key. There doesn't appear to be a limitation, however, in the ssh public key specification for not allowing spaces.
What kind of failure should be returned for the state? Just a string? |
sounds perfect, because yes, no spaces are allowed in the actual key. Yes, a string should be returned adn then evaluated in states/ssh_auth.py |
ssh keys cannot have spaces, return failure string on invalid ssh keys, fix issue where keys with comments were added over and over.
Here is a proposal with certain assumptions for dealing with comments and spaces in ssh authorized keys file.
Assumptions:
Proposal:
I believe 1 is the best way, since 2 could lead to issues where a user has both a space in the key and a comment in the yaml.
The exception would be
SSHInvalidKey
.The text was updated successfully, but these errors were encountered: