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
0
votes
1 answer

How do I configure net-ssh so I can fetch data using rest-client through an ssh tunnel?

We have an elasticsearch setup that is only available from a jump box. I want to set up an ssh tunnel so I can query from my laptop or a Docker container. When I run ssh, either directly or via 'system' the tunnel works and my post fetches data. …
Gary Golub
  • 31
  • 5
0
votes
2 answers

Create a Telnet connection via SSH using Ruby

I am having a slight issue. First and foremost, I had never written a single line of Ruby until being given this task so it is somewhat outwith my remit and comfort zone. This may well be a stupid question but I have searched for what feels like an…
CJL
  • 3
  • 5
0
votes
3 answers

Ruby Net::SSH reuse session

I have a few methods doing this: def method_a Net::SSH.start(...) do |ssh| end end def method_b Net::SSH.start(...) do |ssh| end end def method_c Net::SSH.start(...) do |ssh| end end Each methods call Net::SSH start which…
Gavin Yap
  • 642
  • 12
  • 26
0
votes
0 answers

How can I SSH after establishing a connection with ruby net/ssh gem

I have 2 systems I work with that are daisy chained. System A is what I have to connect to initially, then I ssh into system B to run commands to view status of services and other things. I work doing field support on these systems and have no way…
Nick D
  • 115
  • 8
0
votes
0 answers

Ruby Net::SCP multiple uploads in parallel

I would like to upload multiple files to a remote machine in parallel. This is what I have tried so far based on the documentation Net::SCP.start(ip, user) do |scp| channels = [] dst = 'some_remote_location' stl_files.each do |f| channels…
Rojj
  • 1,170
  • 1
  • 12
  • 32
0
votes
1 answer

net-ssh and ActiveRecord 3: bringing it all together

I'm working on a small Ruby program that will connect to a remote MySQL Bugzilla database, perform a query of records, and email details of those records to a group on a daily basis. So far, I've been able to SSH to the db server and execute a…
Spencer R
  • 1,118
  • 2
  • 14
  • 34
0
votes
1 answer

How to read text from file into an array in ruby

Is there a way to treat the HOST, USER, PASS varibales in the net - ssh gem as an array and have multiple values for them? I currently have an outside text file with the HOST, USER AND PASS values, but i need to pass these into the aforementioned…
CreeFC
  • 13
  • 4
0
votes
0 answers

cap aborted! SSHKit::Runner::ExecuteError: and Net::SSH::AuthenticationFailed for user

I have been trying to deploy a Rails app using Capistrano but when I run cap production deploy I get: (Backtrace restricted to imported tasks) cap aborted! SSHKit::Runner::ExecuteError: Exception while executing as deploy@12.34.56.789:…
Kehinde
  • 11
  • 4
0
votes
1 answer

Threaded output not displayed when run from command (works from irb)

I decided to rewrite a ruby script I did as a gem/module with an executable component. The original works fine, but as a gem it is easier to maintain/install with all dependencies. The command takes an array of hosts and a command, and runs it on…
0
votes
2 answers

PHP Net_SSH2 cannot conect

I am trying to use Net_SSH2 class for login in ssh server and i get error: Notice: No compatible server to client encryption algorithms found in /var/www/html/includes/classes/Net/SSH2.php on line 1389 Code in line 1389 was: $decrypt =…
0
votes
1 answer

Make Net::SSH and Net::SSH::Telnet ask for username

Currently in Ruby's Net::SSH and Net::SSH::Telnet library if I run shell = Net::SSH::Telnet.new("Dump_log" => "/dev/stdout", "Host" => "1.1.1.1") or shell = Net::SSH.start("1.1.1.1") It begins the session using my own username instead of…
redcodefinal
  • 909
  • 3
  • 11
  • 24
0
votes
1 answer

SSH connection fails to disconnect

I have a long-running process (sometimes > 2 hours) that opens an SSH connection (ruby's Net::SSH library), runs a command, then closes the connection. This worked fine in our old VM environment. I've just ported the code to Docker images in GKE and…
jwadsack
  • 5,708
  • 2
  • 40
  • 50
0
votes
1 answer

Read() Write() commands producing unwanted resource id #9

I am attempting to run some ping commands on a server with read() and write() commands. I am using the phpseclib connected to Net_ssh2 but when I try to get the results and see what is happening in the echo $this->ssh->getLog(); Here is the ssh…
user5843278
0
votes
1 answer

Ruby Net::SSH infinity wait for password

I have a simple functional for run some command via ssh, here is an example: ... Net::SSH.start( self.host, self.user, config: true, keys: [self.pem_key] ) do| ssh | result = ssh.exec! self.command ... It works OK except case when I forgot…
Mr. Rails
  • 89
  • 6
0
votes
2 answers

How to SSH to a jumpoff server and SSH from that jumpoff server in Ruby

I was looking for a way to SSH to a jumpoff server using ruby and from that server SSH to another server. The jumpoff server is the only server with access to the final server. I was trying Net::SSH but I can't seem to get an SSH connection from…
amadain
  • 2,724
  • 4
  • 37
  • 58