As described here https://support.cloudbees.com/hc/en-us/articles/218497418-How-to-expose-a-passphrase-authenticated-SSH-key-stored-in-Jenkins-to-the-Docker-instance we can use the sshagent to authenticate to a ssh target, but one still has to provide the username explicitely. If for some reason no only the key, but also the user changes, the script has to be adjusted aswell.
It would be useful to access the user that is provided in the ssh credential and have it injected as environment variable. e.g.
the syntax is very similar to withCredentials and there is also a open pull request to the binding plugin, so I'm so sure if it's the right place to ask for: