Questions tagged [net-ssh]

A pure-Ruby implementation of the SSH2 client protocol. It allows you to write programs that invoke and interact with processes on remote servers, via SSH2.

A pure-Ruby implementation of the SSH2 client protocol. It allows you to write programs that invoke and interact with processes on remote servers, via SSH2. http://net-ssh.rubyforge.org/ssh/v2/api/

207 questions
3
votes
1 answer

How to debug a cap deploy error and find log files for Net::SSH::ChannelOpenFailed network error?

I run into Net::SSH::ChannelOpenFailed error when deploying (the error occurs at capistrano's assets:precompile task - see assets.rb below) and only on one server of two. Both servers have similar installation (Gentoo kernel 3.6, Ruby 1.9.3, rails…
3
votes
1 answer

Run MySQL query over multiple SSH tunnels?

I have a situation somewhat similar to "How to create a ssh tunnel in ruby and then connect to mysql server on the remote host." From my local machine, I want to run a query against a production MySQL database host. My local machine cannot directly…
Chris
  • 748
  • 2
  • 8
  • 23
3
votes
3 answers

cannot load such file -- net/ssh/authentication/agent/socket (LoadError)

If i run rails s /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- net/ssh/authentication/agent/socket (LoadError) from…
Fred Fickleberry III
  • 2,439
  • 4
  • 34
  • 50
2
votes
1 answer

Net::SSH works from production rails console, AuthenticationFailed from production webapp

I have a rails app where a user can submit a form and it goes off and connects to a remote server via ssh to call a script. Eventually I plan to use delayed_job or something like that but I can't get it to work in production with even a simple test.…
2
votes
1 answer

Ruby Net/SSH 7.0.1 - Ubuntu 22 / OpenSSL 3 issue

I'm using Ubuntu 22 and OpenSSL 3 Ruby's Net/SSH is not working any longer as soon as I'm trying to connect using private keys. Net::SSH.start X.X.X.X, "root" /.rvm/gems/ruby-3.1.2/gems/net-ssh-7.0.1/lib/net/ssh/authentication/key_manager.rb:168:in…
user9114945
  • 289
  • 3
  • 14
2
votes
1 answer

Net-SSH Ruby Authentication

Can someone please shed some light on this issue I have with net-ssh. I am new to ruby and am working on this project. How do I tell net ssh to use the username and password provided to connect to the servers without needing to have a shared key…
2
votes
2 answers

Are there any security risks to using "remember_host!" when getting a HostKeyMismatch exception using net-ssh ruby gem?

I have seen people who suggest using a code chunk like this: begin Net::SSH::start rescue Net::SSH::HostKeyError => e e.remember_host! retry end As the exception type suggests, it's for cases where there's a hostkey mismatch, and it adds the…
2
votes
1 answer

Ruby net-ssh-multi: passing a password as a parameter at runtime

I am trying to use net-ssh-multi to run a command on a group of servers. For this taks, ssh-key authentication is not an option; a password has to be passed to each server defined in the session.use lines. Here's the problem, 'net/ssh' can take a…
Dmitri
  • 2,658
  • 2
  • 25
  • 41
2
votes
1 answer

Net::SSH fails to connect

I've written a ruby script to do some work on a remote host. Running it from a Mac with 10.6. The IP works fine with a manual ssh -l devacct 10.10.10.10, but as you can see it fails in the script. require 'rubygems' require…
willcodejavaforfood
  • 43,223
  • 17
  • 81
  • 111
2
votes
1 answer

Interactive SSH session using Net::SSH or creating a STDIN Socket

This is not a duplicate of How to SSH interactive Session or Net::SSH interactive terminal scripting. How? or Ruby net-ssh interactive response/reply I'm trying to write an interactive SSH client using Net:SSH, because I'm already using it for run…
Kimmo Lehto
  • 5,910
  • 1
  • 23
  • 32
2
votes
2 answers

.exe crated using Par::Packer with script containing Net::SSH2 is not working

Am using Net::SSH2 module in my Perl script and trying to make an executable (.exe for windows) using Par::Packer. The script need to ssh to a linux box from a windows box using public keys and don't want to input password. Am facing the below error…
Senthil A Kumar
  • 10,306
  • 15
  • 44
  • 55
2
votes
1 answer

Why key type ecdsa-sha2-nistp256 is unsupported?

I'am trying to use ruby gem net-ssh and receive the error described bellow jruby-9.1.15.0 :001 > require "net/ssh" => true jruby-9.1.15.0 :002 > Net::SSH.start('myhost.dev', 'username' password: 'password', verbose: Logger::DEBUG){|ssh| puts…
qpi
  • 209
  • 3
  • 7
2
votes
2 answers

Store ssh connections in rails

I have a rails app that needs to communicate with a couple of servers through ssh. I'm using the Net::SSH library and it works great. I would like however to be able to cache/store the ssh connections somehow between requests (something like OpenSSH…
alexcepoi
  • 708
  • 1
  • 10
  • 19
2
votes
2 answers

Unable to connect remote host through net/ssh

This is pretty weird. I have my public key added at host machine. I can simply run ssh -p -l hostt.com which simply opens the remote shell. I can even run my capistrano scripts for the deployments on the same machine. But when i…
intellidiot
  • 11,108
  • 4
  • 34
  • 41
2
votes
0 answers

Net::SSH (Ruby, JRuby) hangs on exec!(command)

I'm trying to use Net::SSH to execute commands remotely. I am successful in executing the script on Windows, but in my Unix environment I'm able to connect but fail execute even the simplest commands (e.g. ls, echo). Connection is successful: ssh =…
hgorni
  • 91
  • 1
  • 6