Skip to content

pyinfra not robust for comments at the end of lines in ssh config #1568

@martijnvanveelen

Description

@martijnvanveelen

Describe the bug

Pyinfra is not processing comments in the ./ssh/config properly

To Reproduce

Put comments behind a line like " IdentityFile ~/.ssh/pyinfra_user_key # example comment"

The result of running pyinfra:
--> Connecting to hosts...
[127.0.0.1] Could not connect ([Errno 2] No such file or directory: '/home/martijn/.ssh/pyinfra_user_key # your private key')

Expected behavior

If I can ssh with a username like pyinfra (in my case via an open ssh CA signed key) then I expect that pyinfra will also work ... but that is not the case (not only comments are an issue, I've seen multiple things going working in the past days working with pyinfra)

Meta

Well this is simple enough to reproduce I guess.
I've fixed it by removing the comments. So pyinfra is usuable ... however it could be made more robust

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions