【发布时间】:2021-08-10 09:00:37
【问题描述】:
如何使用 SSH 密钥(从 cPanel 创建)连接到服务器?最终拉出一个新副本并运行作曲家更新和数据库迁移(一个 Symfony 脚本)
我收到权限被拒绝错误,所以我的ssh example.net.au ls -l /staging.example.net.au 正在访问服务器,我只是不确定如何使用 cPanel 制作的密钥进行身份验证。
bitbucket-pipelines.yml
# This is an example Starter pipeline configuration
# Use a skeleton to build, test and deploy using manual and parallel steps
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: atlassian/default-image:2
pipelines:
default:
- parallel:
- step:
name: 'Build and Test'
script:
- echo "Your build and test goes here..."
- step:
name: 'Lint'
script:
- echo "Your linting goes here..."
- step:
name: 'Security scan'
script:
- echo "Your security scan goes here..."
# The following deployment steps will be executed for each pipeline run. To configure your steps and conditionally deploy see https://support.atlassian.com/bitbucket-cloud/docs/configure-bitbucket-pipelinesyml/
- step:
name: 'Deployment to Staging'
deployment: staging
script:
- echo "Your deployment to staging script goes here..."
- echo $TESTVAR
- ssh example.net.au ls -l /staging.example.net.au
- step:
name: 'Deployment to Production'
deployment: production
trigger: 'manual'
script:
- echo "Your deployment to production script goes here..."
【问题讨论】:
-
有趣的问题。找到后请发布解决方案。
-
我会的,我使用他们说明中的实际示例向Atlassian forum 发布了一个类似的问题,也没有任何答案。
-
所以看看人们试图从他们的服务器连接到 bitbucket,似乎 bitbucket 的 22 端口被阻塞,而 443 端口被阻塞。所以
- ssh example.net.au -p 443 ls -l /staging.example.net.au但现在我遇到了 ssh 错误,至少意味着我现在正在建立连接。可能只是我错误地安装了我的证书,当它完全工作时我会发布作为答案。 -
对于其他提出这个问题的人来说,这不是端口问题,密钥设置不正确。
标签: cpanel ssh-keys bitbucket-pipelines