C
C
Ch00ee2015-10-20 21:47:40
linux
Ch00ee, 2015-10-20 21:47:40

How to add your id_rsa to docker?

good evening!
I'm trying to slip my key into the docker container for authorization on the git, but nothing happens.
who solves the problem?

RUN mkdir -p /root/.ssh
ADD id_rsa /root/.ssh/id_rsa
RUN chmod 600 /root/.ssh/id_rsa
RUN eval `ssh-agent -s` && \
    ssh-add /root/.ssh/id_rsa && \
    git clone [email protected]

issues
Host key verification failed.
fatal: The remote end hung up unexpectedly

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nazar Mokrinsky, 2015-10-20
@Ch00ee

id_rsa is something you should NEVER give to ANYONE!
You need id_rsa.pub - the public part.
The public keys on the server go into /root/.ssh/authorized_keys for root, one public key per line.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question