Skip to content

Commit

Permalink
🐞 CI: don't clobber existing .ssh/authorized_keys
Browse files Browse the repository at this point in the history
We accidentally clobbered the jumpbox's ssh's authorized key, sabotaging
the environment for subsequent builds (usually BATS).

This commit fixes that error by _appending_ rather than clobbering the
`authorized_keys` file.

This error has been causing BATS to fail at ~50% of the time, and
it's been like that since 2023-12-13.

Fixes, when running "bats":

```
Failed to download from 'https://s3.amazonaws.com/bosh-compiled-release-tarballs/bpm-1.2.17-ubuntu-jammy-1.406-20240318-191657-766280616-20240318191658.tgz':
  Unable to download:
    Performing GET request:
      Get "https://s3.amazonaws.com/bosh-compiled-release-tarballs/bpm-1.2.17-ubuntu-jammy-1.406-20240318-191657-766280616-20240318191658.tgz": Creating SOCKS5 dialer: get host key: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
```
  • Loading branch information
cunnie committed Mar 23, 2024
1 parent 8638aaa commit b20ab63
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ci/tasks/run-lifecycle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Host jumpbox
StrictHostKeyChecking no
EOF
chmod -R go-rwx ~/.ssh
sshpass -p $BOSH_VSPHERE_JUMPER_PASSWORD scp ~/.ssh/vcpi.pub jumpbox:.ssh/authorized_keys
sshpass -p $BOSH_VSPHERE_JUMPER_PASSWORD ssh jumpbox "cat >> .ssh/authorized_keys" < ~/.ssh/vcpi.pub

# grab OpenVPN client configuration & update it with VCPI jumpbox IP
scp jumpbox:client.ovpn /etc/openvpn/
Expand Down

0 comments on commit b20ab63

Please sign in to comment.