I tried adding:
RUN mkdir /root/.ssh && chmod 0700 /root/.ssh && \
ssh-keyscan -t rsa bitbucket.org >> /root/.ssh/known_hosts && \
ssh-keyscan -t rsa github.com >> /root/.ssh/known_hosts
to the Dockerfile, but with no success. still an error.
still the same:
{
"code": "git_auth_failed",
"message": "ssh: Could not resolve hostname github.com:echtelerp: Name does not resolve\r\nfatal: Could not read from remote repository.\n\nPlease make sure you have the correct access rights\nand the repository exists.\n"
}
Curl from inside the container works:
bash-4.4$ curl -I https://github.com
HTTP/1.1 200 OK
date: Thu, 12 Mar 2020 19:00:46 GMT
content-type: text/html; charset=utf-8
server: GitHub.com
status: 200 OK
vary: X-PJAX, Accept-Encoding, Accept, X-Requested-With
etag: W/"464a7b3ceedf8da9881f224461b7b62f"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
expect-ct: max-age=2592000, report-uri="https://api.github.com/_private/browser/errors"
content-security-policy: default-src 'none'; base-uri 'self'; block-all-mixed-content; connect-src 'self' uploads.github.com www.githubstatus.com collector.githubapp.com api.github.com www.google-analytics.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com wss://live.github.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com; frame-ancestors 'none'; frame-src render.githubusercontent.com; img-src 'self' data: github.githubassets.com identicons.github.com collector.githubapp.com github-cloud.s3.amazonaws.com *.githubusercontent.com customer-stories-feed.github.com spotlights-feed.github.com; manifest-src 'self'; media-src 'none'; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com
Age: 8
Set-Cookie: _gh_sess=NAMtyKcAmSMD%2FKOofKpbidANw3TXB70EwvyUjtDfU%2BMMj7cglIl0tThm8SFR1PhyYKyem8ZmSFGLCgJWcb2MT7CL94ZJyQfk6dZiqv%2BwCOxKld3KEiz%2BEKgxNtk0rrf0YR%2FpjRQ0I6wn4V9ZuAuJPsI%2FMCXdb0ELwmqRxmGBadyJZ2R2E87djN5zfFYCO%2BK3xU7FI90NAq5LRA32V7colUsaZ6MofGmQ6VwiOGYy4yXZcVxyNA8ty%2FLP%2FyhsEj6jGPqFwospZeiY8jYq7j6Wtw%3D%3D--wYJ%2F8qFgdy1AzgB%2B--K%2BJ2YROWEvQ2FvfjlfVo1Q%3D%3D; Path=/; HttpOnly; Secure
Set-Cookie: _octo=GH1.1.1234414116.1584039655; Path=/; Domain=github.com; Expires=Fri, 12 Mar 2021 20:00:55 GMT; Secure
Set-Cookie: logged_in=no; Path=/; Domain=github.com; Expires=Fri, 12 Mar 2021 20:00:55 GMT; HttpOnly; Secure
Accept-Ranges: bytes
X-GitHub-Request-Id: EB2B:22CEE:136FCE8:1B96A86:5E6A86E6
git fetch from bash inside the container asks me to add the ip to trusted... (the Yes/no) question that always comes when first using the git clone command
$ ssh -vT git@github.com delivers:
bash-4.4$ ssh -vT git@github.com
OpenSSH_7.9p1, OpenSSL 1.1.1a 20 Nov 2018
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to github.com [140.82.118.4] port 22.
debug1: Connection established.
debug1: identity file /usr/src/node-red/.ssh/id_rsa type -1
debug1: identity file /usr/src/node-red/.ssh/id_rsa-cert type -1
debug1: identity file /usr/src/node-red/.ssh/id_dsa type -1
debug1: identity file /usr/src/node-red/.ssh/id_dsa-cert type -1
debug1: identity file /usr/src/node-red/.ssh/id_ecdsa type -1
debug1: identity file /usr/src/node-red/.ssh/id_ecdsa-cert type -1
debug1: identity file /usr/src/node-red/.ssh/id_ed25519 type -1
debug1: identity file /usr/src/node-red/.ssh/id_ed25519-cert type -1
debug1: identity file /usr/src/node-red/.ssh/id_xmss type -1
debug1: identity file /usr/src/node-red/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.9
debug1: Remote protocol version 2.0, remote software version babeld-dc59ae57
debug1: no match: babeld-dc59ae57
debug1: Authenticating to github.com:22 as 'git'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: rsa-sha2-512
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ssh-rsa SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8
debug1: Host 'github.com' is known and matches the RSA host key.
debug1: Found key in /usr/src/node-red/.ssh/known_hosts:1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: Will attempt key: /usr/src/node-red/.ssh/id_rsa
debug1: Will attempt key: /usr/src/node-red/.ssh/id_dsa
debug1: Will attempt key: /usr/src/node-red/.ssh/id_ecdsa
debug1: Will attempt key: /usr/src/node-red/.ssh/id_ed25519
debug1: Will attempt key: /usr/src/node-red/.ssh/id_xmss
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa,rsa-sha2-512,rsa-sha2-256,ssh-dss>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /usr/src/node-red/.ssh/id_rsa
debug1: Trying private key: /usr/src/node-red/.ssh/id_dsa
debug1: Trying private key: /usr/src/node-red/.ssh/id_ecdsa
debug1: Trying private key: /usr/src/node-red/.ssh/id_ed25519
debug1: Trying private key: /usr/src/node-red/.ssh/id_xmss
debug1: No more authentication methods to try.
git@github.com: Permission denied (publickey).
assuming all of the above, I would guess, that my in node red generated key has not been added to the ssh client? could that be possible?