Previously working, now my_known_hosts file doesn't exist

Deleted user February 20, 2018

I set up a simple pipeline to do some testing. Previously, it had been working fine. Now, when I try to run a pipeline script, it hangs on 'my_known_hosts' not existing. Known hosts have been fetched and added to the repo. I've even tried with fresh repositories, but still the same error. Here's what I have in my yml config file:


image: atlassian/default-image:1

pipelines:
default:
- step:
script:
- mkdir -p ~/.ssh
- cat my_known_hosts >> ~/.ssh/known_hosts
- (umask 077; echo $[MY_STORED_KEY] | base64 --decode > ~/.ssh/id_rsa)
- sftp [myuser]@[myhost]:[mydirectory] <<< $'put -r *'

 

Here is the error I receive: 

+ cat my_known_hosts >> ~/.ssh/known_hosts

cat: my_known_hosts: No such file or directory

1 answer

0 votes
Deleted user February 20, 2018

Still not sure why the previously working example stopped working, but I forgot a step in the new repo.

ssh-keyscan -t rsa server.example.com &gt; my_known_hosts

Add known hosts to this file and push to the repo.

Philip Hodder
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 5, 2018

Is this issue still occurring? (Just wondering if this was a bug that was fixed)

Also, you may want to check out this guide at some stage for a more straight forward way of setting up SSH keys: https://confluence.atlassian.com/bitbucket/use-ssh-keys-in-bitbucket-pipelines-847452940.html

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events