Skip to content
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

ERR cannot parse identity line: unknown identity format: # OpenSSH authorized_keys file format is described in sshd(8) manual page. #50

Closed
vt-alt opened this issue Dec 17, 2023 · 2 comments · Fixed by #72
Labels
bug Something isn't working

Comments

@vt-alt
Copy link

vt-alt commented Dec 17, 2023

Comments in authorized_keys cause an error: ERR cannot parse identity line: unknown identity format: # OpenSSH authorized_keys file format is described in sshd(8) manual page.

ALT Linux have comment in authorized_keys at the 1st line for each user by default:

# OpenSSH authorized_keys file format is described in sshd(8) manual page.

ps. Alto it's common for users to comment old keys instead of deleting them so this is not an error.

@francoismichel
Copy link
Owner

francoismichel commented Dec 17, 2023

I am using the ssh_config package to parse the config and I am surprised it does not handle that case. Maybe there is a bad edge case with comments in the first line.
I'll have a look and do a quick fix if the problem comes from github.com/kevinburke/ssh_config.

EDIT: seems I misread and the issue was about authorized_identities and not the SSH config.

@francoismichel francoismichel added the bug Something isn't working label Dec 17, 2023
francoismichel added a commit that referenced this issue Dec 18, 2023
Until now, commented lines raised a logging at error level in authorized_indentities and authorized_keys. (#50)
We fixed the logging to explicitly say that empty and commented lines are skipped.
Also added a test case with commented lines in authorized_identities

Fix: #50
@vt-alt
Copy link
Author

vt-alt commented Dec 19, 2023

Thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants