Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR -- : Hook push_to_remote SshError: remote rejected authentication: Failed getting response #3148

Open
Skull0ne opened this issue Apr 30, 2024 · 0 comments

Comments

@Skull0ne
Copy link

Hi

I tried to reconfigure the git hook from user/password to ssh key but I can't find the solution.

The config :

hooks:
  push_to_remote:
    type: githubrepo
    events: [post_store]
    remote_repo: "ssh://git@GIT_URL/infrastructure/oxidized.git"
    privatekey: "/home/oxidized/.ssh/id_rsa"
    publickey: "/home/oxidized/.ssh/id_rsa.pub"

For the remote_repo I also tried "git@GIT_URL:infrastructure/oxidized.git".

The id_rsa key starts with "-----BEGIN RSA PRIVATE KEY-----" and there is no line return at the end.

.ssh folder and key files are owned by the user.

Known_hosts contains the info for my git repo.

I'm able to git clone the repo manually and commit into it :

oxidized@898fd87005f4:~$ git clone ssh://git@GIT_URL/infrastructure/oxidized.git
Cloning into 'oxidized'...
remote: Enumerating objects: 6885, done.
remote: Counting objects: 100% (6885/6885), done.
remote: Compressing objects: 100% (2483/2483), done.
remote: Total 6885 (delta 4401), reused 6878 (delta 4399), pack-reused 0
Receiving objects: 100% (6885/6885), 7.49 MiB | 40.16 MiB/s, done.
Resolving deltas: 100% (4401/4401), done.

[...]

oxidized@898fd87005f4:~/oxidized$ git push
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 8 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 316 bytes | 316.00 KiB/s, done.
Total 3 (delta 2), reused 0 (delta 0), pack-reused 0
To ssh://GIT_URL/infrastructure/oxidized.git
   61e0ee5..7a7ecd4  main -> main

I've added "IdentitiesOnly yes" to my .ssh/config for my gitlab host, without that I couldn't clone the repo.

LIBSSH2 version :

ii  libssh2-1:amd64              1.10.0-3                                amd64        SSH2 client-side library

I tried to enable the debug mode with it didn't give much.

Error :

I, [2024-04-30T21:07:04.171384 #32]  INFO -- : GithubRepo: Pushing local repository(/home/oxidized/.config/oxidized/oxidized.git/)...
I, [2024-04-30T21:07:04.171438 #32]  INFO -- : GithubRepo: to remote: ssh://git@GIT_URL/infrastructure/oxidized.git
E, [2024-04-30T21:07:04.338160 #32] ERROR -- : Hook push_to_remote (#<GithubRepo:0x000055d2585ec358>) failed (#<Rugged::SshError: remote rejected authentication: Failed getting response>) for event :post_store

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant