microsoft / azure-pipelines-tasks

Tasks for Azure Pipelines
https://aka.ms/tfbuild
MIT License
3.5k stars 2.61k forks source link

Feature request: Set SshHostKey for a Service Connection ( CopyFileOverSsh task ) #9591

Closed jepzen closed 4 years ago

jepzen commented 5 years ago

I wanted to use the CopyFileOverSsh task with a service connection. My problem is that to be able to connect and upload file to this specific server I need to provide a SshHostKeyFingerprint.

To test my credentials for the server I used a Powershell script and WinScp.exe. I t required the following settings:

$sessionOptions = New-Object WinSCP.SessionOptions -Property @{ Protocol = [WinSCP.Protocol]::Sftp HostName = "example.com" UserName = "user" Password = "mypassword" SshHostKeyFingerprint = "ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx" }

But in the Service connection I have no option to set the SshHostKeyFingerprint. It only has the option to give a private key.

When not providing I get this error: 2019-02-01T11:27:10.0634867Z ##[error]Failed to connect to remote machine. Verify the SSH service connection details. Failed to connect to remote machine. Verify the SSH service connection details. Error: Handshake failed: no matching host key format..

leantk commented 4 years ago

This issue is stale because it has been open for a year with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days

alexander-smolyakov commented 4 years ago

Hi, @jepzen! Is this problem with SshHostKeyFingerprint still actual to you?

jepzen commented 4 years ago

Not working on that anymore so no priority for me

alexander-smolyakov commented 4 years ago

Closing it since the problem not actual. Feel free to reopen.