Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Identity file (key) not found if there is a blank at the end of config file line #499
Step to reproduce:
1.- Add a space at the end of IdentityFile line in ~/.ssh/config file
BackendException: ssh connection to root@xxxxxxx:22 failed: [Errno 2] No such file or directory: '/home/xxxxxx/.ssh/id_rsa '
Thought I saw a recent patch about trailing whitespace, can't find it but still looking.
Did find #375 which implies we did want this behavior but there's no actual rationale listed...
EDIT: yea, there's a test that #375 was just making sure didn't get accidentally broken:
May dig farther in case there is rationale but usually code that old doesn't have a solid reason in the commit message. I honestly can't think of many reasons why trailing whitespace is something anybody wants, and as per #653's investigation, OpenSSH itself performs trailing whitespace stripping.
Pondering whether we should be super careful re: backwards compat, and fix this in the upcoming 2.0 release. But my gut says it's probably hurting many more people than it could possibly be helping, so maybe treating as a regular bug is the right approach.
Yea I can't find the patch I was remembering so I'm probably crazy or it was posted to another tracker. @56quarters if you want to draft a PR as follows, I'd merge it: