Hi everyone.
I had a weird behaviour on one of our self-hosted pipelines.
I want to deploy and artifact with SCP or Rsync but always get "Host key verification failed" ( both fails ).
Oddest thing is that ssh works like a charm with same config.
I'm pretty sure that it has to be a known_hosts file thing, but I can't figure why.
- I've tried to create a known_hosts file on my repository. Didn't work.
- Update known_hosts on the fly with ssh-keyscan -H $SERVER_IP >> ~/.ssh/known_hosts . Didn't work
- use EXTRA_ARGS: '-o StrictHostKeyChecking=no' . Didn't work.
My last attempt was something like this:
script:
- echo "Deployment test"
- mkdir -p /root/.ssh/
- ssh-keygen -R $SERVER_IP
- ssh-keyscan -H $SERVER_IP >> ~/.ssh/known_hosts
- cat ~/.ssh/known_hosts
- pipe: atlassian/rsync-deploy:0.6.0
variables:
USER: '$USER'
SERVER: '$SERVER_IP'
REMOTE_PATH: '/tmp/testscp/'
LOCAL_PATH: '/var/log/*'
DEBUG: 'true'
Is there any way to make this works that i'm missing?
Thanks a lot for your help.