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
net-ssh doesn't work with ssh-agent/requires Pageant on Windows #192
Comments
Checked some more code. Seems like Pageant is the only option on Windows. Is it possible to add ssh-agent support? |
Do not overwrite Net::SSH::Authentication::PLATFORM if it is already defined. This addresses issues net-ssh#192 and net-ssh#361.
The logic for selecting an agent on Windows (including cygwin) is now as follows: - if ENV[SSH_AUTH_SOCK] is defined, use UNIXSocket - otherwise, use Pageant::Socket This addresses both net-ssh#192 and net-ssh#361.
So...this is kind of ruining vagrant provisioning on Windows machines without Pageant. I would help, but I am not familiar with Ruby. |
@duerst Okay. I was not sure about this since there was so much going on. I hope this is going to be fixed soon. It is a pain in the ass with vagrant currently. |
Hi all, I'm not sure how, but SSH agent forwarding into Vagrant is working properly on my Windows since version 8 (now running Windows 10) without Pageant. Maybe this was fixed on Vagrant side or MINGW64 (terminal). Capistrano probably is still broken. |
https://rubygems.org/gems/net-ssh/versions/4.0.0.beta4 is released and it if you have SSH_AUTH_SOCK and unix_socket it'll try to use that otherwise falls back to pageant. |
@mfazekas It still does not work with net-ssh 5.1.0. I do not want to open another issue, since we have collected so much intel already here. |
Issue summary
I'm using Capistrano on Windows 7.
I've configured ssh-agent to autoload with bash, enabled agent forwarding in ssh config file. Server allows for agent forwarding as well.
Agent forwarding works as intended with
ssh user@exmaple.com
in bash.However, it doesn't work with Capistrano, which uses net-ssh.
I'm not Ruby developer, but I was able to debug it (using Logger:DEBUG):
As far as I can tell, net-ssh tries to find Pageant process and fails on this. I do not have PuTTY, because I'm using bash (coming with Git)
I've found some piece of code that tries to open socket using OpenSSH agent (https://github.com/net-ssh/net-ssh/blob/master/lib/net/ssh/authentication/agent/socket.rb#L65):
which seems like is trying to connect to ssh-agent process, but somehow this action fails.
So, I was forced to install PuTTY and run Pageant in order to get capistrano work.
Issues I see:
Environment details
ruby -ropenssl -e puts OpenSSL::OPENSSL_VERSION'
printsOpenSSL 1.0.0n 6 Aug 2014
openssl version
printsOpenSSL 0.9.8zb 6 Aug 2014
puts ENV['SSH_AUTH_SOCK']
printsC:/Users/user/AppData/Local/Temp/ssh-Pwa62R2DumYh/agent.4028
echo "$SSH_AUTH_SOCK"
prints /tmp/ssh-Pwa62R2DumYh/agent.4028/tmp/ssh-Pwa62R2DumYh/agent.4028
:!<socket >49345 FC1BAE4C-D79B0069-3C0F3DCC-1C0A1A41
. Line ends withNUL
characterIf you need any other details don't hesitate to ask.
The text was updated successfully, but these errors were encountered: