Comments (3)
I created a SOCKS5 proxy and tested Net::SSH before applying the patch and I do see the hanging issue you described.
$ ssh -D 1080 -p 22 -vvv delano@localhost "sleep 1000000"
Using this test script:
# /usr/bin/ruby -Ilib -Itest -rrubygems issue-socks5.rb
$:.unshift 'lib'
require 'net/ssh'
require 'net/ssh/proxy/socks5'
pr = Net::SSH::Proxy::SOCKS5.new( 'localhost', 1080 )
ssh = Net::SSH.start('localhost', 'delano', :proxy => pr, :verbose => :debug)
ch = ssh.open_channel
puts ssh.exec! 'ls'
However, after applying the patch it still hangs for me.
I managed to fix the hang by adding a check to ServerVersion#negotiate! to make sure the socket is readable.
46,48
break unless socket.available_for_read?
b = socket.recv(1)
After that the SOCKS5 proxy seemed to work fine. Would you be able to send me the steps you use to reproduce the problem you're seeing?
$ ruby -v
ruby 1.9.1p129 (2009-05-12 revision 23412) [i386-darwin9.6.0]
$ openssl version
OpenSSL 0.9.8d 28 Sep 2006
from net-ssh.
From Gerald:
Ok I see now, your doing everything over localhost and there is no DNS
really in the equation at all. That might explain why the SOCKS5 patch code
wasn't really doing anything for you.
So what you need to do is have a ssh session with a socks proxy where when
you connect to some other host.
So this :
ssh = Net::SSH.start('localhost', 'delano', :proxy => pr, :verbose =>
:debug)
changes to:
ssh = Net::SSH.start('someotherhost.com', 'delano', :proxy => pr, :verbose
=> :debug)
then that would exercise the code in socks5.rb and might show you the null
condition.
from net-ssh.
Re-added refactored fix for hanging in ServerVersion#negotiate! when using SOCKS5 proxy [Gerald Talton]. Closed by d5a6437
from net-ssh.
Related Issues (20)
- Race condition doing successive exec!
- Error: EVP_PKEY_sign: passed a null parameter
- deploying to server with ed25519 genereated key fails HOT 1
- Fails to set client `host_key` to `ssh-ed25519` HOT 2
- Getting error undefined method 'keys' for PASSWORD: string HOT 1
- Remove hmac-*-96 algorithms HOT 2
- How does append_all_supported_algorithms work? HOT 1
- Connections using hmac-etm gets closed by remote host HOT 4
- Net::SSH.start does not work with configs with IdentityAgent options HOT 1
- Do we have a way to enable FIPS-only mode for net-ssh library HOT 3
- net-ssh 7.1.0 - Incorrectly determines ED25519 when Private Key is RSA HOT 2
- Pubkey authentication results in SSH::Disconnect from server in Net-SSH 7.2 HOT 3
- Raises exception when loading SSH Keys with using windows new lines HOT 2
- No output while executing bash script with parameter HOT 1
- Add support for RequiredRSASize and PubkeyAcceptedKeyTypes in openssh config HOT 1
- Connection Failure on FIPS mode when debug mode is enabled. HOT 1
- Unable to establish SSH connection due to key exchange algorithm mismatch HOT 1
- 7.2.2 giving me error when using sshkit to remotely execute commands HOT 10
- (Net::SSH::HostKeyMismatch) random error when connecting to Debian 12 (OpenSSH_9.2)
- unsupported key type `rsa-sha2-512' (NotImplementedError) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from net-ssh.