-
Notifications
You must be signed in to change notification settings - Fork 26
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
Is it working? #25
Comments
If your rc files are starting the agent properly, you'll get an environment variable for the socket. Try running " In fact, the easiest way to test operation directly is " I don't know anything about babun, but in a quick search it doesn't look like they tweak ssh at all, so it's probably ok there. |
|
OK, the first two results indicate that the environment isn't being set in your rc files. What exactly did you add? The last one seems to be working, just that your running Pageant doesn't have any keys in it at the moment. Otherwise you would have seen a connection error like the standalone |
I do have my key loaded in Pageant...
Right now i'm in zsh, but I tried switching to bash with the same results. |
What happens if you run that eval line directly in the shell? Or maybe try the very simple And actually, I just found that with an empty Pageant, So I'm really not sure what's going on when you get nothing from For comparison, does charade work for you? |
|
How about " I have a hunch that maybe babun is a 32-bit cygwin environment, and maybe you downloaded 64-bit ssh-pageant? Or vice-versa. But I just found that running the wrong/mixed versions will fail silently with exit code 127, as If that's the case, go download the other bit version. :) Unfortunately, there's nothing I could do in ssh-pageant to diagnose this, because this would be a failure to run the program at all. I can try to clarify this in the README though. |
I downloaded both versions
😞 |
OK, that "i686" means this is 32-bit Cygwin. Also WOW64 is the confusing name for the environment of 32-bit applications running on 64-bit Windows. Yet they both fail? Ugh. I just double-checked that I didn't mess up the 32-bit download either. How about Actually, ssh-pageant 1.4 just started using some additional Cygwin APIs, like |
OK, I downloaded babun and looked at dependency walker of ssh-pageant against that version of cygwin1.dll, and it's missing symbol The prebuilt ssh-pageant 1.3 did not link to that symbol, so it may actually work for you. However, when I try a fresh build of 1.3, I do get that symbol now, so it must be something changed in newer Cygwin. By that logic, you might also be ok compiling your own copy of 1.4 in babun's older Cygwin. |
After compiling it from source when I relaunch babun I get
and in the process list I see
|
It's a good sign that the process started! But if So now it's just a question of getting that environment variable set. When you don't say Or you can cheat and set BTW, thank you for sticking with this so long! I will definitely have to collect some of these troubleshooting steps into the README. |
And I really appreciate you responding so quickly to help me troubleshoot this. 👍 hmm, it does seem like
and then |
To be clear, you're manually running the assignment and export too? Just running ssh-pageant won't do, as it can't change the environment of the shell. (That's why it's usually an eval line.) |
I added
to my |
Since you see the pid line, the eval must be running, as that echo is one of the commands from ssh-pageant. I can only guess that something else is overriding it later. Maybe put your own line like |
@mxxcon, have you discovered anything else? |
I'm sorry, i've been busy last couple of days. I'll poke around with this some more. |
Looks like this is something I'll try to troubleshoot this a bit more, otherwise will post in babun's repo to help me figure out what's going on. |
Going to piggy back off this issue. I'm also using babun, and experiencing a similar issue. However, I have $SSH_AUTH_SOCK set, I see the process is started, and PuTTY's pageant is running with my private key loaded: # env | sort
SHELL=/bin/bash
SSH_AUTH_SOCK=/tmp/.ssh-pageant-[username]
SSH_PAGEANT_PID=5948
SVN_SSH=C:\Users\[username]\code\PuTTY\plink.exe # ssh-add -l
Could not open a connection to your authentication agent. # ssh-pageant ssh-add -l
Could not open a connection to your authentication agent. # ssh-pageant -v
ssh-pageant 1.4
Copyright (C) 2009-2014 Josh Stone
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Edit: Not sure if it's suppose to, but the socket referenced in SSH_AUTH_SOCK never gets created (i.e. Edit2: This is what's in my .bashrc file eval $(/usr/bin/ssh-pageant -r -a "/tmp/.ssh-pageant-$USERNAME") |
@Ginja It's probably just a typo, but you have a repeat in your It's troubling that even A couple other useful commands: |
@cuviper yes it was a typo, sorry. I'm using Pageant version 0.63, and here's the output of the command you suggested: $ stat $SSH_AUTH_SOCK ; ps -fW | grep -i pageant
stat: cannot stat `/tmp/.ssh-pageant-[username]': No such file or directory
0 5240 0 ? 15:00:58 C:\Users\[username]\code\PuTTY\pageant.exe
0 8960 0 ? 19:13:13 C:\Users\[username]\.babun\cygwin\bin\ssh-pageant.eked,xe Edit: I'm able to successfully use ssh-pageant if I use plink, but I don't think that's a good thing (merely based on what you mentioned in #13) ssh-pageant plink.exe hostname In case it matters, I am using a .ssh/config file that I use on non-Windows servers, which points to the non-pageant key, but I've tried commenting it out, and replacing the Identity File value with the .ppk key. But still no luck. |
Well, plink will talk to pageant directly, so ssh-pageant isn't doing anything there. Are you mixing runtimes? That So, it's not necessarily a problem for your ssh-pageant to use a different runtime than the other ssh programs, as long as the socket implementation is still compatible. You'll have to try and see. But I think the first problem here is that they have different mount namespaces. That is, Either rebuild ssh-pageant in the same runtime, or try a common path for the socket. As of 1.4, it should work fine to use a Windows path for this, so perhaps: |
Thanks for your help, @cuviper. I was able to resolve the issue by compiling the latest ssh-pageant from source. Previously I was downloading the latest binary, and moving it over to /usr/bin. $ ssh-pageant.exe ssh-add -l
2048 [hash] imported-openssh-key (RSA)
$ stat $SSH_AUTH_SOCK ; ps -fW | grep -i pageant
File: `/tmp/.ssh-pageant-[username]'
Size: 0 Blocks: 1 IO Block: 65536 socket
Device: 1e0078h/1966200d Inode: 2533274790429416 Links: 1
Access: (0600/srw-------) Uid: (35556/[username]) Gid: ([gid]/Domain Users)
Access: 2015-02-13 09:22:40.557201900 -0800
Modify: 2015-02-13 09:22:40.558201900 -0800
Change: 2015-02-13 09:22:40.558201900 -0800
Birth: 2015-02-13 09:22:40.557201900 -0800
0 1316 0 ? 09:16:58 C:\Users\[username]\code\PuTTY\pageant.exe
[username].sh 5532 1 ? 09:22:40 /usr/bin/ssh-pageant |
Great! I'm still curious, do you have multiple cygwins installed and in your path? The downloaded copy of ssh-pageant must have been getting its runtime from somewhere... Also, you gave me the idea for #28, which will be useful to know if ssh-pageant can talk to pageant at all. And I still need to capture essential steps from this whole discussion into documentation, which is why I'm leaving this open. |
I do have multiple cygwins in my path. And I really should look at uninstalling it because I prefer Babun's installation. #28 sounds like a good idea. |
Are you sure the environment is set? The first three lines of your screenshot show just the output of running ssh-pageant, but you have to actually run those commands to modify your environment. The easiest way to do that is like this for bash: When you run |
What shell is it?
I would first check whether |
it's just a regular command prompt (cmd.exe). The file is present, yes. Modifying the quotation marks to doublequotes, and all the slashes to either backslashes or regular ones doesn't give any different result. |
Ah, Try a bare value, maybe even |
Oh, that one worked. Wow. |
It looks like you're using a fixed |
So I've noticed. Yeah, I'll do just that. |
Cool project. Can't get it to work using prebuilt cygwin64 1.4. Pageant is definitely running and has my keys added and works elsewhere in Windows.
This results in
However....
And...
Any ideas? I feel like perhaps it cannot communicate with Pageant but I am not smart enough to go further. |
@kenchilada Are your ssh-pageant and ssh-add running in the exact same Cygwin environments? What version of Pageant are you running? I really should get around to #28... |
I think I was trying something stupid. I've been connecting to my machine through sshd with putty.exe, and thought this would all work everywhere because ssh-pageant is using a socket. I suppose what I was looking for was really just agent forwarding in putty.exe. If I use regular Cygwin mintty like a normal person, the I'm curious why it didn't work like I thought? Is it simply because sshd.exe is running as a different user and cannot access the socket? |
Ah yeah, when running via sshd you can just use normal agent forwarding. Normally, ssh-pageant doesn't access any socket (except for the -r reuse test) - it creates a socket for others that want that unixy interface. It accesses Pageant through Windows messages, and you're probably in a different security context under sshd than the Pageant running on the desktop. |
How can I tell if this is properly working, and if not, how to troubleshoot this?
I'm using https://github.com/babun/babun
I have Pageant running. I installed your ssh-pageant into /usr/bin/, I added provided snippet into both my .bashrc and .zshrc, restarted my shell. However, when I try to ssh to a remote host i'm still prompted for a password.
If I use plain putty or other 'regular' terminal app, Pageant picks up key authentication..
The text was updated successfully, but these errors were encountered: