-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Medium
-
None
-
Affects Version/s: 4.2.8
-
Component/s: GitLab
-
None
-
Severity 2 - Major
I just set up a GitLab Enterprise account in Sourcetree on a new machine to connect via SSH, which included the generation of a new SSH key. When I attempted to clone a repository, SSH configuration failed as follows:
/Users/UNAME/.ssh/config line 7: keyword identityfile extra arguments at end of line /Users/UNAME/.ssh/config: terminating, 1 bad configuration options
Sourcetree had generated the following file (with some redactions):
# --- Sourcetree Generated --- Host gitlab.example.com HostName gitlab.example.com User UNAME PreferredAuthentications publickey IdentityFile /Users/UNAME/.ssh/UNAME-GitLab Enterprise UseKeychain yes AddKeysToAgent yes # ----------------------------
I worked around this by surrounding the resulting file path in quotes, as suggested here.
Related Issue: https://jira.atlassian.com/browse/SRCTREE-8052
This was supposedly fixed as part of the 4.2.4 release. The issue highlighted 2 bad configuration options (including this one), but the workaround provided in the comments dealt only with the Host value. It's not clear if this option was overlooked in that fix, or was recently reintroduced as a regression.
A similar fix may be necessary for other account host types that generate an SSH key with a file name containing whitespace.