__ssh_authorized_keys overwrites existing keys #147
Labels
No labels
bugfix
cleanup
discussion
documentation
doing
done
feature
improvement
packaging
Stale
testing
TODO
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: ungleich-public/cdist#147
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Created by: pcoder
If a given key is not a valid public key or if it contains some whitespaces at the end,
__ssh_authorized_keys
seems to overwrite the existing authorized keys.Here are the two cases that I found erroneous.
Created by: darko-poljak
@pcoder Ok, I will prepare a fix for an invalid key case.
Created by: pcoder
I think you are right there @darko-poljak I may have overlooked this.
Created by: darko-poljak
@pcoder Nope, it works with this key. Are you sure you have only this in your manifest and that it clears existing file?
Created by: pcoder
@darko-poljak check this out
Created by: darko-poljak
@pcoder I cannot reproduce a case where key is valid but has trailing whitespace. Do you have an example?
I have reproduced a case where key is invalid. Here the problem is in explorer/entry.
Created by: pcoder
Whats worse is that if we have many keys in authorized_keys file, all of them are overwritten with only
testtesttestsetestststestsetest
Created by: pcoder
@darko-poljak
or at least if the public ssh key is not a valid format, the original key should not to be overwritten
Created by: darko-poljak
@pcoder Can you give an example?
So that I know what to reproduce.
Created by: darko-poljak
@pcoder I will take a look soon.