Windows VMs, Alpine Linux docker images, Debian Buster ("testing"), macOS 10.13.6, and OpenBSD 6.3 installations which use OpenSSH 7.7 (on Windows as part of Git on Windows 2.17 and Git on Windows 2.18) use the wrong username when cloning git repos with ssh (private key authentication). They're using jenkins when git is explicitly specified.
Note, most importantly,
Running a git clone manually using an ssh agent works fine:
- Switch the username in the private key credential from the "actual user" to "git" (for example, instead of "MarkEWaite", use "git" as the credential username)
- Switch to use username/password with https rather than a private key credential
- Switch to use JGit as the git implementation for affected Jenkins jobs instead of command line git
- Use a different version of OpenSSH (7.6 or earlier)