New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Copy Files Over SSH: Cannot parse privateKey: Unsupported key format #8818
Comments
@compilenix Are you still dealing with this issue? |
Yes |
I have the same exact issue, I can connect fine with the RSA private key to the server but not pipeline "Copy Files Over SSH" |
The Copy Files over SSH task uses the SSH2 npm package (https://www.npmjs.com/package/ssh2) for the SSH connections, so it appears that the error is coming from there. The task itself does not do any key parsing. Based on this stack exchange post it sounds like certain versions of OpenSSH will generate a key in a newer format that is not compatible. Could you try adding the Also see here for more info and another option: If that doesn't work, could you tell me your Operating System and OpenSSH version so that I can look into this issue a bit more. |
It worked when creating a ssh key using this command: Operating System: Ubuntu 16.04.5 LTS I think this command should be documented somewhere (maybe via this issue?) |
@joshmgross thanks this worked. I think the Copy Files Over SSH is using an old verion of ssh2 library, the new version has already been updated but from what I saw the Copy Files Over SSH task will have the update this February late or beginning of March. After that I will recreate my keys with OpenSSH mode. |
Glad it worked. I've updated the documentation with this workaround. |
thanks, Your comment worked for me. |
👋 @SuperDuperOne please open a new issue, this one is closed. |
Environment
Server - Azure Pipelines or TFS on-premises?
TFS on-premises
Version 16.122.27409.2
Agent - Hosted or Private:
If using Hosted agent, provide agent queue name:
If using private agent, provide the OS of the machine running the agent and the agent version:
OS: Ubuntu 16.04.5 LTS
Agent Version: 2.122.2
Issue Description
Task name: Copy Files Over SSH
The task is not able to parse the ssh private key, provided by the endpoint type "ssh".
I've tried the following commands to generate a rsa key:
and
neither format versions does work.
example key:
using the key from a linux host to connect to an other host via bash does work.
Task logs
ReleaseLogs_9.zip
Error logs
[error]Failed to connect to remote machine. Verify the SSH endpoint details. Error: Cannot parse privateKey: Unsupported key format.
The text was updated successfully, but these errors were encountered: