I inherited some code; among other things, there is a custom authorized_keys
file with X.509 keys in a format like this one:
x509v3-sign-rsa subject:O=GrandsChocolatiers Ltd.,OU=Management,OU=Top
The process is such, that the SSH reads from the custom /mydir/authorized_keys
file, if the /.ssh/authorized_keys
file does not provide the correct key. This was all going ok, except, there was a change in one key, and a comma (,
) had to be added to one key value.
subject:O=GrandsChocolatiers, Ltd.,OU=Management,OU=Top
Now, I get an sshd error
error: x509key_str2X509NAME: cannot parse 'Ltd.'
error: key_read: uudecode subject:O=GrandsChocolatiers, Ltd.,...
I have tried to escape this in the keys file using \,
,\\,
putting the string in single and double quotes, but the error is still there, although the error text changes with the inserted symbol.
Is there any way for SSH to escape the comma when reading the keys? Is there a way to put a different format of the key?
I did a man authorized_keys
on the box and read the manual. It says that a slash can also be used to separate, but, it is used in combination with a comma, so no go there.
Note: The key cannot be changed.
GrandsChocolatiers, Ltd.
or escaping it?Separator of Subject items can be ‘/’ (slash), ‘,’ (comma) or mixed and order is not important.
subject
value. If putting the value into quotes does not help, it is probably content for bug report for the author of this patch.subject:OU=Top,OU=Management,O=GrandsChocolatiers, Ltd.
?