如何通过 SSH 在 azure devops 管道复制文件中使用公钥 [英] How to use public key in azure devops pipline copy files over SSH

查看:61
本文介绍了如何通过 SSH 在 azure devops 管道复制文件中使用公钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Azure DevOps 将 Laravel 应用程序部署到 Bluehost 网站.

I'm trying to use Azure DevOps to deploy a Laravel application to a Bluehost website.

这个想法是,当我对我的存储库提交更改时,将触发管道并运行 Composer,然后部署到网站.

The idea is that when I commit changes to my repo, that a pipeline will trigger and will run composer, then deploy to the website.

我遇到的问题是 Bluehost 的身份验证失败,即使在我授权了 SSH 密钥之后(我可能只授权了公钥).

The issue I am having, is that authentication with Bluehost fails, even after I've authorized the SSH key(I may only authorize public keys).

错误:无法连接到远程机器.验证 SSH 服务连接详细信息.无法连接到远程机器.验证 SSH 服务连接详细信息.错误:所有配置的身份验证方法均失败..

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: All configured authentication methods failed..

我的理论是,DevOps 正在生成一个新的公钥来登录 BlueHost,但它无法进行身份验证(因为它不是授权的公钥).

My theory, is that DevOps is generating a new public key to log into BlueHost, which fails to authenticate(as it's not the authorized public key).

我看到有一个安装 SSH 密钥";我可以使用的任务;但是,我不明白如何在通过 SSH 复制"中使用下载的密钥.任务.

I see that there is an "Install SSH Key" task I can use; however, I don't understand how to use the downloaded key in the "Copy over SSH" task.

如何在 Azure DevOps 管道通过 SSH 复制任务中使用公钥?

How can I use a public key in an Azure DevOps pipeline Copy over SSH task?

推荐答案

使用Copy Files Over SSH任务的前提如下:

  • 该任务支持使用 SSH 密钥对连接到远程机器.
  • 公钥必须预先安装或复制到远程机器.

当您使用 安装 SSH 密钥 任务,SSH 密钥安装在远程机器上.您不需要在 Copy Files Over SSH 任务中下载它.检查以下示例:

When you use Install SSH Key task, the SSH keys are installed on the remote machine. You don't need to download it in Copy Files Over SSH task. Check the following example:

https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/install-ssh-key?view=azure-devops#example-setup-using-github

这篇关于如何通过 SSH 在 azure devops 管道复制文件中使用公钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆