-
Notifications
You must be signed in to change notification settings - Fork 145
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
Need fix while generating metadata for ssh_keys #454
Comments
weird that it fails, but there was no specific reason for leaving the comment out. |
@icco, |
@kgaikwad First of all - apologies for not getting back to you sooner. Don't currently have a lot of free time so this fell off my radar. I think the issue is that your key is not in an expected format. Standard pubkey generated by
I've tried stripping the end off, e.g.:
, and then I could reproduce the issue you were describing. What command/lib are you using to generate the keys? |
@Temikus I believe the user@host is just an optional comment for the key and we should not expect it to be set as it is just a convention, but you can easily have the key left out. Should we ensure the comment is present, if without it we fail? Here is a key parser of gitlab: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/gitlab/ssh_public_key.rb#L26 which internally uses Could we use this parser in similar fashion, to actually parse and validate the key? |
Line-557 generates metadata for ssh-keys.
The expect format of each ssh-key is
"[USERNAME_1]:ssh-rsa [EXISTING_KEY_VALUE_1] [USERNAME_1]"
mentioned in the google document.Here -> Line-557 adds "[USERNAME_1]:ssh-rsa [EXISTING_KEY_VALUE_1]".
Any specific reason that it is not appending
[USERNAME_1]
at the end of string? As user can pass comment while creating ssh-key itself but what if user wants to use same key.Using current code, I am facing error on VM edit from google console -
'Invalid key. Required format: [email protected] or google-ssh {"userName":"[email protected]","expireOn":""}'
The text was updated successfully, but these errors were encountered: