Private github repository with composer

We have a private github repository and I’m trying to setup SSH key access without much luck it’s not reading the SSH config for github.

On my local mac development machine I have updated my .ssh/config file with:

Host github.com-system
 HostName github.com
 User git
 IdentityFile ~/.ssh/github/system.pem
 IdentitiesOnly yes

To test this works from terminal:

ssh -T git@github.com
Hi myusername! You've successfully authenticated, but GitHub does not provide shell access.

But when I login to the container to test the command I get error permission denied.
ssh -vT git@github.com

OpenSSH_7.9p1 Debian-10+deb10u2, OpenSSL 1.1.1d  10 Sep 2019
debug1: Reading configuration data /home/devilbox/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to github.com [140.82.121.3] port 22.
debug1: Connection established.
debug1: identity file /home/devilbox/.ssh/id_rsa type 0
debug1: identity file /home/devilbox/.ssh/id_rsa-cert type -1
debug1: identity file /home/devilbox/.ssh/id_dsa type -1
debug1: identity file /home/devilbox/.ssh/id_dsa-cert type -1
debug1: identity file /home/devilbox/.ssh/id_ecdsa type -1
debug1: identity file /home/devilbox/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/devilbox/.ssh/id_ed25519 type -1
debug1: identity file /home/devilbox/.ssh/id_ed25519-cert type -1
debug1: identity file /home/devilbox/.ssh/id_xmss type -1
debug1: identity file /home/devilbox/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.9p1 Debian-10+deb10u2
debug1: Remote protocol version 2.0, remote software version babeld-2aa5ef1f
debug1: no match: babeld-2aa5ef1f
debug1: Authenticating to github.com:22 as 'git'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: rsa-sha2-512
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ssh-rsa SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8
debug1: Host 'github.com' is known and matches the RSA host key.
debug1: Found key in /home/devilbox/.ssh/known_hosts:10
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: Will attempt key: /home/devilbox/.ssh/id_rsa RSA SHA256:SSx/UKjpdQ2lmEIEdz/bT1DJ/IFIbugmztX6b7Ajad4
debug1: Will attempt key: /home/devilbox/.ssh/id_dsa 
debug1: Will attempt key: /home/devilbox/.ssh/id_ecdsa 
debug1: Will attempt key: /home/devilbox/.ssh/id_ed25519 
debug1: Will attempt key: /home/devilbox/.ssh/id_xmss 
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp256-cert-v01@openssh.com,sk-ssh-ed25519-cert-v01@openssh.com,sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,ssh-ed25519,ecdsa-sha2-nistp521,ecdsa-sha2-nistp384,ecdsa-sha2-nistp256,rsa-sha2-512,rsa-sha2-256,ssh-rsa,ssh-dss>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /home/devilbox/.ssh/id_rsa RSA SHA256:SSx/UKjpdQ2lmEIEdz/bT1DJ/IFIbugmztX6b7Ajad4
debug1: Authentications that can continue: publickey
debug1: Trying private key: /home/devilbox/.ssh/id_dsa
debug1: Trying private key: /home/devilbox/.ssh/id_ecdsa
debug1: Trying private key: /home/devilbox/.ssh/id_ed25519
debug1: Trying private key: /home/devilbox/.ssh/id_xmss
debug1: No more authentication methods to try.
git@github.com: Permission denied (publickey).

When I run: sh check-config.sh

# ==============================================================================
# Checking git
# ==============================================================================
[ERR]   git is unclean
?? composer.json
?? composer.lock
?? data/mongo/
?? data/mysql/
?? data/pgsql/
?? debugger-logger.txt
?? docker-compose.override.yml.txt
?? log/mariadb-10.1/
?? log/mariadb-10.2/
?? mail/
?? output.log
?? package-lock.json
?? php-includes/

# ==============================================================================
# Checking .env file
# ==============================================================================
[SUCC]  .env file exists
[SUCC]  .env file is readable
check-config.sh: line 193: syntax error near unexpected token `<'

Also verified the /home/devilbox/.ssh/config has been updated to include the github.com config.

Devilbox v1.9.0

Following this guide: Managing deploy keys - GitHub Docs

Composer supports GitHub tokens, take a look here:

https://getcomposer.org/doc/articles/authentication-for-private-packages.md