I am attempting to push a git repo to github with ssh. I can authenticate but I cannot push.
I am using a ssh key called ssh_key_test1 and this gets employed when on Powershell when I run ssh -vT [email protected]
I get
OpenSSH_for_Windows_8.6p1, LibreSSL 3.4.3
debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
debug1: Connecting to github.com [140.82.121.4] port 22.
debug1: Connection established.
debug1: identity file C:\Users\i1B541167/.ssh/id_rsa type 0
debug1: identity file C:\Users\i1B541167/.ssh/id_rsa-cert type -1
debug1: identity file C:\Users\i1B541167/.ssh/id_dsa type -1
debug1: identity file C:\Users\i1B541167/.ssh/id_dsa-cert type -1
debug1: identity file C:\Users\i1B541167/.ssh/id_ecdsa type -1
debug1: identity file C:\Users\i1B541167/.ssh/id_ecdsa-cert type -1
debug1: identity file C:\Users\i1B541167/.ssh/id_ecdsa_sk type -1
debug1: identity file C:\Users\i1B541167/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file C:\Users\i1B541167/.ssh/id_ed25519 type -1
debug1: identity file C:\Users\i1B541167/.ssh/id_ed25519-cert type -1
debug1: identity file C:\Users\i1B541167/.ssh/id_ed25519_sk type -1
debug1: identity file C:\Users\i1B541167/.ssh/id_ed25519_sk-cert type -1
debug1: identity file C:\Users\i1B541167/.ssh/id_xmss type -1
debug1: identity file C:\Users\i1B541167/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_8.6
debug1: Remote protocol version 2.0, remote software version babeld-32c28593
debug1: compat_banner: no match: babeld-32c28593
debug1: Authenticating to github.com:22 as 'git'
debug1: load_hostkeys: fopen C:\Users\i1B541167/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen __PROGRAMDATA__\ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen __PROGRAMDATA__\ssh/ssh_known_hosts2: No such file or directory
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ssh-ed25519
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: SSH2_MSG_KEX_ECDH_REPLY received
debug1: Server host key: ssh-ed25519 SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU
debug1: load_hostkeys: fopen C:\Users\i1B541167/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen __PROGRAMDATA__\ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen __PROGRAMDATA__\ssh/ssh_known_hosts2: No such file or directory
debug1: Host 'github.com' is known and matches the ED25519 host key.
debug1: Found key in C:\Users\i1B541167/.ssh/known_hosts:1
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: [email protected] RSA SHA256:5aGyYpSOjqW4y96tfoz1WLe+/7xcQucTM+xaWc865pM agent
debug1: Will attempt key: C:\Users\i1B541167/.ssh/id_rsa RSA SHA256:AC0Md8NfTa8RrXyKJgQgJItHiyO3tYWjVPkGkQOb0uo
debug1: Will attempt key: C:\Users\i1B541167/.ssh/id_dsa
debug1: Will attempt key: C:\Users\i1B541167/.ssh/id_ecdsa
debug1: Will attempt key: C:\Users\i1B541167/.ssh/id_ecdsa_sk
debug1: Will attempt key: C:\Users\i1B541167/.ssh/id_ed25519
debug1: Will attempt key: C:\Users\i1B541167/.ssh/id_ed25519_sk
debug1: Will attempt key: C:\Users\i1B541167/.ssh/id_xmss
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],ssh-ed25519,ecdsa-sha2-nistp521,ecdsa-sha2-nistp384,ecdsa-sha2-nistp256,rsa-sha2-512,rsa-sha2-256,ssh-rsa>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: [email protected] RSA SHA256:5aGyYpSOjqW4y96tfoz1WLe+/7xcQucTM+xaWc865pM agent
debug1: Server accepts key: [email protected] RSA SHA256:5aGyYpSOjqW4y96tfoz1WLe+/7xcQucTM+xaWc865pM agent
debug1: Authentication succeeded (publickey).
Authenticated to github.com ([140.82.121.4]:22).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: pledge: filesystem full
debug1: client_input_global_request: rtype [email protected] want_reply 0
debug1: client_input_hostkeys: searching C:\Users\i1B541167/.ssh/known_hosts for github.com / (none)
debug1: client_input_hostkeys: searching C:\Users\i1B541167/.ssh/known_hosts2 for github.com / (none)
debug1: client_input_hostkeys: hostkeys file C:\Users\i1B541167/.ssh/known_hosts2 does not exist
Learned new hostkey: RSA SHA256:uNiVztksCsDhcc0u9e8BujQXVUpKZIDTMczCvj3tD2s
Learned new hostkey: ECDSA SHA256:p2QAMXNIC1TJYWeIOttrVc98/R1BUFWu3/LiyKgUfQM
Adding new key for github.com to C:\Users\i1B541167/.ssh/known_hosts: ssh-rsa SHA256:uNiVztksCsDhcc0u9e8BujQXVUpKZIDTMczCvj3tD2s
Adding new key for github.com to C:\Users\i1B541167/.ssh/known_hosts: ecdsa-sha2-nistp256 SHA256:p2QAMXNIC1TJYWeIOttrVc98/R1BUFWu3/LiyKgUfQM
debug1: update_known_hosts: known hosts file C:\Users\i1B541167/.ssh/known_hosts2 does not exist
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
Hi eliseodifolco! You've successfully authenticated, but GitHub does not provide shell access.
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 4084, received 3632 bytes, in 0.2 seconds
Bytes per second: sent 17622.1, received 15671.7
debug1: Exit status 1
but then when I try
git push -u origin HEAD:main
I get permission denied
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
running
git remote -v
shows that the relevant origin is picked up
origin [email protected]:eliseodifolco/api_test.git (fetch)
origin [email protected]:eliseodifolco/api_test.git (push)
could it be that the ssh service finds the relevant key only for some commands such as ssh -T [email protected]
which is successful?