【发布时间】:2018-09-06 22:06:04
【问题描述】:
我正在使用 Git 说明并尝试使用 Bitbucket Pipelines 部署到我的远程服务器。
在阅读了一些关于此的帖子并查看其他人的尝试后,我正在使用以下代码:
# This is a sample build configuration for PHP.
# Check our guides at https://confluence.atlassian.com/x/e8YWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: samueldebruyn/debian-git
pipelines:
default:
- step:
script:
- umask 077 - echo $MY_SSH_KEY | base64 --decode > ~/.ssh/id_rsa
- scp -i ~/.ssh/id_rsa -P $SERVER_PORT -r $DIRECTORY_TRANSFER_LIST $USERNAME@$SERVER_IP_ADDRESS:~/site
需要指出的是,环境变量是:
DIRECTORY_TRANSFER_LIST:这是我没有 www 的域。即 domain.co.uk
MY_SSH_KEY:我尝试了公钥和私钥,但似乎没有什么不同。
SERVER_PORT:22
我实际上不确定图片的含义以及为什么此链接在这里,这可能是我的问题?
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for '/root/.ssh/id_rsa' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "/root/.ssh/id_rsa": bad permissions
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
lost connection
在准备另一篇关于相同错误消息的帖子后,尽管与 Bitbucket Pipelines 无关。建议将 chmod 更改为 400。
所以我 ssh 进入远程服务器并将 id_rsa 的权限更改为 400:
cd ~/.ssh
chmod 400 id_rsa
但是当我重新运行管道时,这并没有任何区别。
我没有做什么?
【问题讨论】:
-
chmod后的错误信息是什么?
-
和我觉得奇怪的一模一样
-
那你改权限的文件真的是/root/.ssh/id_rsa吗?
标签: ssh permissions bitbucket bitbucket-pipelines