suddenly circleci containers start refusing my ssh connections. I believe it start happening after I updated the GPG key but I have no clue how this could be connected.
$ ssh git@github.com
PTY allocation request failed on channel 0
Hi jandudulski! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
The used for authentication to github is also offered while connecting to circle:
debug1: Offering public key: /home/jandudulski/.ssh/id_rsa RSA SHA256:XfGPsB5pqXKbzic4XlbioYCRCc/AMuBuMNZQmNMn50w agent
debug1: send_pubkey_test: no mutual signature algorithm
I am seeing identical behavior except I have not changed a gpg key. Is it possible circleci changed something regarding minimum key length or algo? I have a 2048 bit length SHA256-RSA key that has worked in the past. It still authenticates to GitHub without issue. It is only sshing to circleci jobs that give me the error:
debug1: send_pubkey_test: no mutual signature algorithm
A newly generated 4096 bit length SHA256/RSA key still did not work.
debug1: send_pubkey_test: no mutual signature algorithm
I followed the CircleCI debugging post as well as read through the Github blog post.
@brandonw 's fix worked for me, eg. generate a new SHA256/ED25519 key (ssh-keygen -t ed25519) and upload that key to my Github account.
A co-worker of mine pointed out that there were some breaking changes as of OpenSSH 8.8 that may affect signatures used. From https://www.openssh.com/txt/release-8.8:
This release disables RSA signatures using the SHA-1 hash algorithm
by default. This change has been made as the SHA-1 hash algorithm is
cryptographically broken, and it is possible to create chosen-prefix
hash collisions for <USD$50K [1]
Incompatibility is more likely when connecting to older SSH
implementations that have not been upgraded or have not closely tracked
improvements in the SSH protocol. For these cases, it may be necessary
to selectively re-enable RSA/SHA1 to allow connection and/or user
authentication via the HostkeyAlgorithms and PubkeyAcceptedAlgorithms
options.
Indeed if I add the suggested changes to ~/.ssh/config, I can get past the error above with my old keys:
This would imply that CircleCI is using an old SSH agent and needs to update for compatibility with newer client agents. Or CircleCI needs to inform users to update to a SHA256/ED25519 key.