The function key_try_load_public() in authfile.c always uses the key's pathname as the comment, ignoring any comment actually given in the public key file.
Created attachment 178 [details] Proposed patch This patch returns the keyfile's comment if there is one, the keyfile's path otherwise.
This won't work through protocol 2 agent connections IIRC
*** Bug 566 has been marked as a duplicate of this bug. ***
> *** Bug 566 has been marked as a duplicate of this bug. *** This is so embarrassing - I didn't remember I had already filed this patch. Sorry for that. Anyway, the patch here is not working correctly, as it doesn't strip the newline at the end of the comment, so I'll attach the new one. > This won't work through protocol 2 agent connections IIRC Mhmm, could you go a bit more into detail? Why should /home/foo/.ssh/id_rsa.pub work when placed in *commentp, but not someone@example.com
Created attachment 296 [details] New patch, now strips newline
Created attachment 1964 [details] /home/djm/ssh-authfile-preserve-comments.diff Revised diff
this will be in openssh-5.9
close resolved bugs now that openssh-5.9 has been released