-
Notifications
You must be signed in to change notification settings - Fork 35
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
"Windows OpenSSH agent is already running" #246
Comments
Also having a similar issue.
For the time being I am able to run pageant + keeagent in client mode + https://github.com/vuori/weasel-pageant and bypass this + correctly load keys. |
Edit: @r2evans, @jacobblock: It was able to get it working again by using @dlech: Your plugin has been working really well for many years now, even seamlessly with FileZilla FTP (SFTP) and other clients that internally use SSH libraries. This is a new issue that became apparent today, |
I used KeeAgent without that problem till 1809 and made a fresh install today to 1903 and this error pops up. OK, it was the environment variable SSH_AUTH_SOCK which broke everything. After deleting (and restarting) it works again! |
For me is even weirder: If I set SSH_AUTH_SOCK then ssh from powershell doesn't work. If I remove the environment variable then ssh starts working but git stops working! I can fix by adding SSH_AUTH_SOCK in git bash but in powershell I still can't use git. Any ideas ? |
You enabled in the options the experimental feature for OpenSSH? |
Yes enabled. I think I found the fix. git (when installed from git for windows package) uses it's own embeded openssh distribution. All fine if you use the git bash terminal where it's safe to set SSH_AUTH_SOCK For using git in powershell and vscode I set: GIT_SSH=C:\WINDOWS\System32\OpenSSH\ssh.exe and appears to be working now |
@silviuvulcan, @Nama: How have you configured it for WSL (Bash on Windows)? |
I didn't. |
@dlech, I wonder if my original post on this issue is about the interface recognizing that the existing socket is its own, and it doesn't need to complain about it nor necessarily restart the service (though that is a different discussion). |
@r2evans, @silviuvulcan, @Nama: WSL 2 + KeeAgent works without issues using this HOWTO. |
Thanks @starsis, glad something is working. While I'm grateful for the update (really!), I wish it weren't based on tools that are explicitly no longer being supported/developed. I'll likely give it a try to start the migration of windows-to-wsl2 dev work, though, at least as a proof of multiple concepts. Thanks again! |
@r2evans: I hadn't tested yet whether Windows sockets are now finally supported on WSL 2 – Edit:
It is possible to
|
So I got it finally working on WSL 2 (yes, there were indeed issues!). |
Hello @strarsis
Don't know what to do. My only target is to access remote machines from wsl via ssh. Nothing else, no git-communications or something else. Thanks for support! |
# KeeAgent
export SSH_AUTH_SOCK=$HOME/.ssh/agent.sock
ss -a | grep -q $SSH_AUTH_SOCK
if [ $? -ne 0 ]; then
rm -f $SSH_AUTH_SOCK
( setsid socat UNIX-LISTEN:$SSH_AUTH_SOCK,fork EXEC:"npiperelay.exe -ei -s //./pipe/openssh-ssh-agent",nofork & ) >/dev/null 2>&1
fi (Don't forget to source the Note: When saving the KeeAgent options, I get the following error message:
However, it still works great! |
Thanks for your fast response! it's working now :-) Maybe you can describe the whole workflow for Keepass with KeeAgent and all the stuff in your howto.md... Documentations like that helped me in past to configure this stuff :-) |
@Bond246: I updated the Howo gist: https://gist.github.com/strarsis/e533f4bca5ae158481bbe53185848d49 |
This should be fixed by dlech/SshAgentLib@55ffc83. Can you please try https://github.com/dlech/KeeAgent/suites/5172458555/artifacts/156862998 to confirm? |
Sorry to say @dlech that that version of the plgx completely hangs my KeePass2. My steps:
Currently: win11, KP-2.50 (64-bit) portable installation. Plugins: KeeAgent-0.12.1.0 (before this attempt) and KeePassQuickUnlock-2.4.0.0. |
Yikes! Now that you mention it, I recall a few times that I had a "zombie process"-like problem while working on this in Visual Studio and had to restart Visual Studio to get it to compile again. Was the process "keepass.exe" or something else? There were some other major changes that could be contributing to the issues you are seeing too. Can you create a new database file with some test keys to reproduce the problems you are seeing? |
I'm not sure where the problem starts, all I can say are the symptoms: KP2 accepted my password but never really finished painting its canvas, becoming unresponsive. I tried with a fresh kdbx and it did not hang, which is promising. The JourneyMore troubleshootingSo:
So I started fishing around in the kdbx itself. I did the following actions:
After that, it opened without hanging. It gets better. Old issue fixed, a new breakI then restored to the previous version of the kdbx (undoing each of those three steps above), and again removed all I then started over:
So ... what changed?For grins, I then tried to see what had changed, in case something corrupted the original KP binaries/libraries. $ cd /mnt/c/PortableApps/KeePass2
$ find . -type f -print0 | xargs -0 -I{} -n1 diff -q {} ../KeePass2.broken/{}
Files ./Plugins/KeeAgent.plgx and ../KeePass2.broken/./Plugins/KeeAgent.plgx differ
$ cd/mnt/c/PortableApps/KeePass2.broken
$ find . -type f -print0 | xargs -0 -I{} -n1 diff -q {} ../KeePass2/{}
diff: ../KeePass2/./KeeAgent.plgx.new: No such file or directory
diff: ../KeePass2/./KeeAgent.plgx.orig: No such file or directory
diff: ../KeePass2/./KeePass.config.xml.bak: No such file or directory
diff: ../KeePass2/./KeePassQuickUnlock.plgx: No such file or directory
Files ./Plugins/KeeAgent.plgx and ../KeePass2/./Plugins/KeeAgent.plgx differ
diff: ../KeePass2/./saved/KeePass.config.xml: No such file or directory
diff: ../KeePass2/./saved/KeePass.exe.config: No such file or directory Most of the Bottom line(waaaay too long to get here) The new plgx you provided (still reports I hate windows. |
Scratch that ... it works the first time, but on the next attempt to connect it does not function. r2@local$ ssh remote
## it works
r2$remote$ ^D # logout
r2@local$ ssh remote
r2@remote's password:
If I lock/unlock KP2, it still does not work. If I exit/restart KP2, it works fine. Once. If I exit KP2, then copy the original (not-alpha) KA plgx (and purge the r2@local$ ssh remote
## it works
r2$remote$ ^D # logout
r2@local$ ssh remote
## it works
r2$remote$ |
Hi @r2evans, thanks for testing. I'm going to go ahead and close this issue since it seems the original issue is resolved. Can you open a new issue for the new problems you are seeing? I'm not able to reproduce any of the problems you are seeing now, so will need some sort of test database and config file that can reproduce the problem. |
I do not see how the new problem is unrelated: discarding the "hang" issues I had (that I've put behind me), the plgx you provided me fixes the popup problem but renders the plgx almost useless by requiring me to exit and restart KP2 every time I want to use KeeAgent's functionality. Doesn't that suggest that your fix for the original problem is incomplete? |
There have been quite a few other change too, so it is hard to say. This issue is getting quite long anyway, which is part of the reason why I suggested starting a new issue. |
Does |
Also today's latest build: https://github.com/dlech/KeeAgent/suites/5186479235/artifacts/157740356 It has more changes/fixes but I don't expect it to fix the problems you are seeing. |
I encountered this issue again today. And I noticed this happened after updating TortoiseSVN/TortoiseGIT. @dlech: With the KeeAgent build you linked I noticed the new WSL compatible socket option in KeeAgent options. That's great! |
I haven't followed this full discussion. KeeAgent used to work without any errors until I recently upgraded to the latest version. Now I am seeing the same issue everytime I restart Windows. |
This issue is closed, so I would suggest starting a new issue with full details on how the reproduce the issue using the latest release. |
is there a way to solve this problem without having to install keepassx (or whatever it's called) ? seems very strange to have to install a password manager. are we expected to store our ssh key in keepass thing? I dont want to as I have yubikey that does this. asking because every single article/issue says "lol install this keepass thing and do stuff". |
My solution was following:
Look for it in PATH of Windows. |
When I open KeePass > KeeAgent options (even if I make no changes), I see this:
I've been trying to get KeeAgent to work with WSL (still having problems with
socat
and related tools, not sure why), so I have tried several combinations of cywgin, msysgit, and windows ssh agent (showing all enabled here).Basic functionality (in GfW bash, not wsl) still works. I don't know if this would preclude windows-ssh or indicates some other problems I might not (yet) be seeing.
win10_64, KeePass-2.39.1, KeeAgent-0.10.1.0, KeePassQuickUnlock-2.4.0.0, KeeTrayTOTP-0.9.4.0
Side note: there's an extra "s" in the source:
KeeAgent/KeeAgent/KeeAgentExt.cs
Line 316 in 9a47555
perhaps it should be:
The text was updated successfully, but these errors were encountered: