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

sshAgent not working eventhough configured #240

Closed
EugenMayer opened this issue Jan 10, 2021 · 1 comment
Closed

sshAgent not working eventhough configured #240

EugenMayer opened this issue Jan 10, 2021 · 1 comment

Comments

@EugenMayer
Copy link

EugenMayer commented Jan 10, 2021

My ssh agent is running

Running this on latest manjaro

ps ax | grep agent
1706 ?        Ss     0:00 /usr/bin/ssh-agent -a /run/user/1000/ssh-agent.socket

Socket exposed

env | grep SSH_AUTH
SSH_AUTH_SOCK=/run/user/1000/ssh-agent.socket

And i have the identity added

ssh-add -l           
2048 SHA256:<REDACTED> /home/:<REDACTED/.ssh/id_rsa (RSA)

And using the agent this wa

func fetch(repository *gitlib.Repository) error {
	agent, err := ssh.NewSSHAgentAuth("")
	if err != nil {
		return err
	}
	opts := &gitlib.FetchOptions{
		Auth: agent,
		RefSpecs: []config.RefSpec{"refs/*:refs/*", "HEAD:refs/heads/HEAD"},
	}
	if err := repository.Fetch(opts); err != nil {
		return err
	}
	return nil
}

Finally the error

ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain

The remote is configured as

git remote -v
origin ssh://git@github.com/<redacated>/<redacted>.git (fetch)
origin ssh://git@github.com/<redacated>/<redacted>.git (pull)

I cannot see how my configuration might be broken or similar. Let me know if i missed something / you need anything

@pjbgf
Copy link
Member

pjbgf commented Nov 7, 2023

Closing assuming that #403 fixed it. Feel free to reopen if that isn't the case.

@pjbgf pjbgf closed this as completed Nov 7, 2023
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

2 participants