Here my config
`defaults: &defaults
docker:
- image: circleci/node:8.2.1
working_directory: /home/circleci/revvy-ui
version: 2
jobs:
build:
<<: *defaults
steps:
- checkout
- persist_to_workspace:
root: /home/circleci/revvy-ui
paths:
- .
publish:
<<: *defaults
steps:
- attach_workspace:
at: /home/circleci/revvy-ui
- run:
name: Check
command: ssh -T git@github.com
workflows:
version: 2
build-publish:
jobs:
- build
- publish:
requires:
- build
filters:
branches:
only: ci
So output i am getting
#!/bin/bash -eo pipefail
ssh -T git@github.com
The authenticity of host 'github.com (192.30.253.113)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)?
Seems like in âpublishâ we donât have public keys
If i will do
command: ssh -T git@github.com
in build job it works fine
1 Like
levlaz
December 17, 2017, 7:08pm
2
You can disable strict host key checking if you wish.
-o StrictHostKeyChecking=no
As shown in this SO post
Getting this error
#!/bin/bash -eo pipefail
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no
usage: ssh [-1246AaCfgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
[-D [bind_address:]port] [-E log_file] [-e escape_char]
[-F configfile] [-I pkcs11] [-i identity_file]
[-L [bind_address:]port:host:hostport] [-l login_name] [-m mac_spec]
[-O ctl_cmd] [-o option] [-p port]
[-Q cipher | cipher-auth | mac | kex | key]
[-R [bind_address:]port:host:hostport] [-S ctl_path] [-W host:port]
[-w local_tun[:remote_tun]] [user@]hostname [command]
Exited with code 255
rohara
December 18, 2017, 4:04pm
4
It looks like you missed the hostname in that attempt.
#!/bin/bash -eo pipefail
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no github.com
Warning: Permanently added âgithub.com ,192.30.253.112â (RSA) to the list of known hosts.
Permission denied (publickey).
Exited with code 255
Its give error
As i understand basically
when i do âcheckoutâ step it add my public key command âssh -T git@github.com â pass
but when i dont do âcheckoutâ it gives
"The authenticity of host âgithub.com (192.30.253.113)â canât be established."
so question is how can i pass âssh -T git@github.com â without checkout ?
i tried âadd_ssh_keysâ with fingerprints but no result ?
this way helps but don think its good solution
run: mkdir -p ~/.ssh
run: echo âgithub.com ssh-rsa C1yc2EAAAABIwAAAQEAâŚâ >> ~/.ssh/known_hosts