Skip to content

support agent-less ssh operation #1023

Open

Description

@NobbZ

Please guide me to a way to provide additional information…

Yes, I use SSH URLs for git.
No, they are not password protected.

If though starting SSH-Agent and adding the key, the error becomes:

Error: ssh: handshake failed: knownhosts: key mismatch

Regular git operations against the remote work.

Activity

  1. patricioantoniotoledo commented on Sep 25, 2023

    @patricioantoniotoledo

    cd ~/.ssh
    ssh-add ~/.ssh/id_rsa

    might help

  2. NobbZ commented on Nov 5, 2023

    @NobbZ
    Author

    To be honest, I do not even (want to) use SSH-agent.

    I want the configured SSH-config to be respected and the command to just work.

    I stoped using git-bug because of this a couple of days after posting this issue without a reply.

  3. octvs commented on Dec 21, 2023

    @octvs

    Might be related, I had a similar issues prompting an handshake fail, which was fixed by building from source.

  4. dllud commented on Jan 24, 2024

    @dllud

    I was facing the exact same error in the title. Besides starting a SSH Agent eval "$(ssh-agent -s)" and adding the key ssh-add ~/.ssh/mykey, I had to use a full URL (ssh://[email protected]:22/path/to/project.git) in the git remote. Only this got git bug push/pull working. This workaround was reported by @Subfortytwo at #572.
    It seems like the SSH Agent does not read my ~/.ssh/config?

    Anyway, I am on the same page as @NobbZ: I would rather avoid using a SSH Agent. Is that possible? It wasn't needed last time I used git-bug (a couple years ago).

  5. github-actions commented on Jul 23, 2024

    @github-actions

    This bot triages untriaged issues and PRs according to the following rules:

    • After 90 days of inactivity, the lifecycle/stale label is applied
    • After 30 days of inactivity since lifecycle/stale was applied, the issue is closed

    To remove the stale status, you can:

    • Remove the lifecycle/stale label
    • Comment on this issue
  6. stackengineer commented on Nov 2, 2024

    @stackengineer

    Not stale. Also looking for an agentless solution, preferably respecting ~/.ssh/config.

  7. added
    kind/featureRelates to a new feature
    priority/important-longtermImportant over the long term, but may not be staffed and/or may require multiple releases
    on May 10, 2025
  8. added this to the milestone on May 10, 2025
  9. changed the title [-]Error: error creating SSH agent: "SSH agent requested but SSH_AUTH_SOCK not-specified" on `git bug push`[/-] [+]support agent-less ssh operation[/+] on May 10, 2025
  10. modified the milestones: , 0.9.0 on May 10, 2025
  11. sudoforge commented on May 13, 2025

    @sudoforge
    Contributor

    catching up with some (old) comments here. i'm sorry there hasn't been a response on this issue.


    @NobbZ:

    If though starting SSH-Agent and adding the key, the error becomes:

    Error: ssh: handshake failed: knownhosts: key mismatch
    

    Regular git operations against the remote work.

    hmm, this shouldn't be happening. if you can ssh to the host (or git push to it), git-bug should work as well (with a few caveats).

    i've introduced a few fixes for ssh-related operations (namely: resolving the URI), but git-bug still doesn't read your ~/.ssh/config (which we need to do manually because go-git doesn't), so if you have custom ports or configuration in there, git-bug won't be able to pick it up.

    if you (or someone else) is still able to reproduce this (with [email protected] or greater), please let me know.


    @dllud:

    I had to use a full URL (ssh://[email protected]:22/path/to/project.git) in the git remote
    It seems like the SSH Agent does not read my ~/.ssh/config?

    this shouldn't be the case anymore. i technically have fully qualified SSH URIs like this because i use url.*.insteadOf remapping, but i've tested without those using git's shorthand <user>@<hosname>:foo/bar.git and that works without issue. as mentioned above, however, custom configuration in ~/.ssh/config isn't parsed.


    yes, i think that git-bug should "just work" like git does. getting to this point is a focus for me in the near term.

  12. dllud commented on May 13, 2025

    @dllud

    Thanks for reviving this @sudoforge !

    git's shorthand (scp like syntax) won't work for me (until ~/.ssh/config gets parsed) as I need to set a custom port. The scp like syntax does not allow setting a custom port number.

    Current status for me on version 0.9.0 is:

    • A SSH Agent is still needed. If I try a git bug pull or push without starting an agent, I get:

    Error: error creating SSH agent: "SSH agent requested but SSH_AUTH_SOCK not-specified"

    • ~/.ssh/config is not honored.

    Hope you can find the time to fix both and get git-bug to seamlessly work just like git. ;)

  13. sudoforge commented on May 13, 2025

    @sudoforge
    Contributor

    git's shorthand (scp like syntax) won't work for me (until ~/.ssh/config gets parsed) as I need to set a custom port. The scp like syntax does not allow setting a custom port number.

    yeah, this is something i know about -- parsing custom ssh config is on my radar.

    in the meantime, if your only need is to specify a custom port, using the full RFC-3986-compliant URI would work for you:

    ssh://you@host:1234/foo/bar.git
    

    NOTE
    you could even handle this remapping in your git config using url.<base>.insteadOf configuration property.

    support for this was added in git-bug:v0.8.1 (a150cdb)


    A SSH Agent is still needed. If I try a git bug pull or push without starting an agent, I get:

    Error: error creating SSH agent: "SSH agent requested but SSH_AUTH_SOCK not-specified"
    

    yep - this is on my radar as well.

    generally speaking, the way git-bug is currently written makes a lot of assumptions about your git configuration, your ssh configuration, and the types of remotes you're interacting with. these are the core issues i want to solve in the near term, as they are silly, and outright blocking people.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/sshRelates to SSHkind/featureRelates to a new featurepriority/important-longtermImportant over the long term, but may not be staffed and/or may require multiple releases

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions