我遇到了这个错误:
$ git push heroku master
Warning: Permanently added the RSA host key for IP address '50.19.85.132' to the list of known hosts.
! Your key with fingerprint b7:fd:15:25:02:8e:5f:06:4f:1c:af:f3:f0:c3:c2:65 is not authorized to access bitstarter.
Run Code Online (Sandbox Code Playgroud)
我试图添加密钥,我在下面收到此错误:
$ ssh-add ~/.ssh/id_rsa.pub
Could not open a connection to your authentication agent.
Run Code Online (Sandbox Code Playgroud) 我有一个应用程序,使用Git执行各种有趣的东西(如运行git clone和git push),我正在尝试停靠它.
我遇到了一个问题,虽然我需要能够在容器中添加SSH密钥以供容器"用户"使用.
我尝试将其复制/root/.ssh/,更改$HOME,创建一个git ssh包装器,但仍然没有运气.
这是Dockerfile供参考:
#DOCKER-VERSION 0.3.4
from ubuntu:12.04
RUN apt-get update
RUN apt-get install python-software-properties python g++ make git-core openssh-server -y
RUN add-apt-repository ppa:chris-lea/node.js
RUN echo "deb http://archive.ubuntu.com/ubuntu precise universe" >> /etc/apt/sources.list
RUN apt-get update
RUN apt-get install nodejs -y
ADD . /src
ADD ../../home/ubuntu/.ssh/id_rsa /root/.ssh/id_rsa
RUN cd /src; npm install
EXPOSE 808:808
CMD [ "node", "/src/app.js"]
Run Code Online (Sandbox Code Playgroud)
app.js 像git一样运行git命令 git pull
我已经复制了这个代码,似乎是各种工作的dockerfiles,这是我的:
FROM ubuntu
MAINTAINER Luke Crooks "luke@pumalo.org"
# Update aptitude with new repo
RUN apt-get update
# Install software
RUN apt-get install -y git python-virtualenv
# Make ssh dir
RUN mkdir /root/.ssh/
# Copy over private key, and set permissions
ADD id_rsa /root/.ssh/id_rsa
RUN chmod 700 /root/.ssh/id_rsa
RUN chown -R root:root /root/.ssh
# Create known_hosts
RUN touch /root/.ssh/known_hosts
# Remove host checking
RUN echo "Host bitbucket.org\n\tStrictHostKeyChecking no\n" >> /root/.ssh/config
# Clone the conf files into the docker container
RUN git …Run Code Online (Sandbox Code Playgroud) 我使用PuTTY Key Generator生成带密码的4096位RSA-2密钥.
我保存.ppk和openSSL格式的公钥.putty格式的公钥不起作用.
无论如何,我的错误如下:
$ ssh -T git@github.com
key_load_public: invalid format
Enter passphrase for key '/c/Users/Dan/.ssh/id_rsa':
Hi Dan! You've successfully authenticated, but GitHub does not provide shell access.
Run Code Online (Sandbox Code Playgroud)
有什么问题?
我使用Pageant来加载密钥,我使用Git Bash来尝试ssh连接.我还把密钥加载到GitHub中,不知道我做错了什么.
我尝试添加一个新行,而不是在GitHub中添加新行
我的同事和我一直试图让我的macbook ssh进入我们的AWS生产服务器而没有运气,这在几个月前确实有效,但是当我们昨天去做时 - 我们不断收到以下错误消息.
(我在以下所有部分用占位符替换了我的用户名和主机名)
$ ssh titan-data
Load key "/Users/aronlilland/.ssh/id_rsa.pub": invalid format
user@my_ip_address: Permission denied (publickey).
Run Code Online (Sandbox Code Playgroud)
<!-- config file -->
Host titan-data
HostName my_ip_address
User user
IdentityFile ~/.ssh/id_rsa.pub
AddKeysToAgent yes
Run Code Online (Sandbox Code Playgroud)
我已经完成了可以想象的每一步,让它再次运行,这些是我按顺序完成的以下步骤:
这一步重复了几次,我通过这个消除过程重新生成了我的.pub文件4次.错误似乎是本地的,但不是来自服务器的东西,如果我错了,有人需要纠正我.
drwx------ 6 aronlilland staff 192B Jan 18 09:41 .ssh/
Run Code Online (Sandbox Code Playgroud)
drwx------ 6 aronlilland staff 192B Jan 18 09:41 ./
drwxr-xr-x+ 104 aronlilland staff 3.3K Jan 16 16:09 ../
-rw-r--r-- 1 aronlilland staff 114B Jan 18 09:37 config
-rw------- 1 aronlilland staff 1.7K Jan 18 09:41 …Run Code Online (Sandbox Code Playgroud) 我正在尝试克隆一个包含子模块的存储库。主 repo 克隆正常,但是当我git submodule update --init --recursive在 dockerfile 中执行时,子模块抛出并出错。
fatal: clone of 'git@github.com:jkeys089/lua-resty-hmac.git' into submodule path '/tmp/third-party/lua-resty-hmac' failed
Failed to clone 'third-party/lua-resty-hmac'. Retry scheduled
Cloning into '/tmp/third-party/lua-resty-jwt'...
load pubkey "/root/.ssh/id_rsa": invalid format
Warning: Permanently added the RSA host key for IP address '140.82.118.3' to the list of known hosts.
Load key "/root/.ssh/id_rsa": invalid format
git@github.com: Permission denied (publickey).
Run Code Online (Sandbox Code Playgroud)
在图像中我有这个
# authorise ssh host
RUN mkdir /root/.ssh/ \
&& chmod 700 /root/.ssh \
&& ssh-keyscan github.com > /root/.ssh/known_hosts
# …Run Code Online (Sandbox Code Playgroud) 我目前正在尝试做的是从 Gitlab CI/CD Docker 容器触发远程机器上的脚本。作业配置如下:
stages:
- deploy
image: maven:3.3.9
server-deploy:
stage: deploy
allow_failure: false
script:
## Install ssh agent
- apt update && apt install openssh-client -y
- eval $(ssh-agent -s)
## Create SSH key file
- "echo \"-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
QyNTUxOQAAACByjJBGT21Arna/pirWVXQqGAr/aszqQ5HzvrA2MzVDZAAAAJiGKEEKhihB
CgAAAAtzc2gtZWQyNTUxOQAAACByjJBGT21Arna/pirWVXQqGAr/aszqQ5HzvrA2MzVDZA
AAAEAKbObQgJGXbrKQt4wdCy3YQfpVBqkT5RNEt2IYU5pv3HKMkEZPbUCudr+mKtZVdCoY
Cv9qzOpDkfO+sDYzNUNkAAAAFHN2ZW5AREVTS1RPUC0xTjVKUjRSAQ==
-----END OPENSSH PRIVATE KEY-----\" > deploy-key"
## Fix permissions on key file and .ssh folder
- chmod 700 deploy-key; mkdir -p ~/.ssh; chmod 700 ~/.ssh
## Import SSH key
- ssh-add -k …Run Code Online (Sandbox Code Playgroud)