oxidized: Rugged::SshError: Failed to authenticate SSH session
Hi, I’m having a problem pushing to Git. I’m seeing this error in the logs:
ERROR -- : Hook push_to_remote (#<GithubRepo:0x00000000cb1c40>) failed (#<Rugged::SshError: Failed to authenticate SSH session: Unable to send userauth-publickey request>) for event :post_store
If I test my connection to Git it works fine using this:
ssh -T git@github.mydomain.com
I’m running the exact same container image, same config and same SSH key pair at a different location and it works there fine. Any ideas?
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 3
- Comments: 20 (1 by maintainers)
If you have
-----BEGIN OPENSSH PRIVATE KEY-----
in your private key you need to change it to PEM format.https://serverfault.com/questions/939909/ssh-keygen-does-not-create-rsa-private-key
ssh-keygen -p -m PEM -f ~/.ssh/id_rsa
For those who hit this who may have generated a key on OSX, Check that it has produced a ‘normal’ looking id_rsa file. My OSX install (where I made the key) made a key with:
-----BEGIN OPENSSH PRIVATE KEY-----
as it’s bannerI’ve found the solution to my problem. My SSH private key a the second site contained a blank line after
-----END RSA PRIVATE KEY-----
. It worked fine withgit clone/push
commands but didn’t work when Oxidized used it - is that due to Oxidized using rugged/libssh2 whereas git doesn’t maybe?Anyway, you can put this down to user error - I hadn’t spotted the blank line in the key file at the second site so I was incorrect in saying I had identical SSH keys in both sites.
@jerebernard @tomasell @activekerrar - does this help you?