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
1
vote
1 answer

Multiple SSH hops with Net::SSH (Ruby)

So here's my setup: Laptop -> Host 1 -> Host 2 -> Host 3 Laptop can reach Host 1, but not Host 2 or Host 3 Host 1 can reach Host 2, but not Host 3 Host 3 can reach Host 2, but not Host 1 What I'm trying to do is set up remote forwards so that a…
Aaron
  • 121
  • 1
  • 7
1
vote
0 answers

Calling scp from net:ssh

Here's the setup: I have server A, which is running my ruby scripts and servers B & C. I need to be able to transfer files from B to C. I've experimented with using Net:SCP, but I haven't found a way to set up a transfer between the two remote…
Jakanapes
  • 75
  • 7
1
vote
2 answers

Using ruby gem net-ssh to configure a Juniper router

I'd like to be able to use the ruby net-ssh gem to make changes to a Juniper M10i router. However, after sending "configure", I am unable to send any configuration commands. For example, after logging in to the router via ssh, I'd like to issue the…
uhleeka
  • 698
  • 8
  • 19
0
votes
1 answer

What to do when Net-SSH complains about exec! method missing?

This is driving me crazy. I run into this every now and then on a new ubuntu/debian server. Basically I can't do a exec! through net-ssh. Note, that I can require 'net/ssh' perfectly fine. sample code require 'rubygems' require…
eyberg
  • 3,160
  • 5
  • 27
  • 43
0
votes
1 answer

How to check SSH connection with Rails 5.2 and Net::SSH.start

I need to check whether the SSH connection to a remote server I use is correct or not. I issue the following test: begin session = Net::SSH.start(uri, login, password: password) session.close Rails.logger.interactions.info ' …
user1185081
  • 1,898
  • 2
  • 21
  • 46
0
votes
2 answers

Remote execution of SSH command hangs in ruby using Net::SSH for a particular command

I found a similar question here, but the answer in such a question didn't work for me. I am trying to connect the remote ssh server via ruby using Net::SSH. It is working fine for me for all the commands provided via script and I could read the…
LeandroS
  • 61
  • 6
0
votes
1 answer

Ruby net/ssh is not running bash commands in background

I am having a hard time running bash commands in background from a Ruby script. For this question, I am using a simplified example. This is how commands are working as expected when I run them from PuTTY. running basch commands in background (click…
LeandroS
  • 61
  • 6
0
votes
1 answer

Errno::ENOTTY Inappropriate ioctl for device when connecting to a remote server through Net::SSH on SuSe (with Ruby on Rails 5.2.4)

My Ruby on Rails application remotely starts some scripts on a distant SuSe server (SUSE Linux Enterprise Server 15 SP2). It relies on the net-ssh gem which is declared in the Gemfile: gem 'net-ssh'. The script is triggerd remotely through the…
user1185081
  • 1,898
  • 2
  • 21
  • 46
0
votes
1 answer

Net::SFTP keeps throwing errors in resque

I am running rails 3.1rc4 and keep running into this error message in my resque queues uninitialized constant Net::SFTP With the exception "NameError" In my gemfile I have included: gem 'net-sftp' gem 'net-ssh' gem 'net-scp' I included net-scp,…
Flashuni
  • 41
  • 1
  • 8
0
votes
1 answer

How to properly close a Net::SSH connection?

Many articles demonstrate Net::SSH by using a block, such as the following: Net::SSH.start("host", "user") do |ssh| ssh.exec! "cp /some/file /another/location" hostname = ssh.exec!("hostname") ssh.open_channel do |ch| ch.exec "sudo -p…
LewlSauce
  • 5,326
  • 8
  • 44
  • 91
0
votes
1 answer

After uploading a file using Net::Sftp, the file disappears sometimes

I use net-sftp gem for uploading file to remote server. Net::SFTP.start(host, user, port: port, key_data: [decoded_key], keys: [], keys_only: true, logger: logger, verbose: :debug) do |sftp| sftp.upload!(local_file_path,…
0
votes
0 answers

Remote server doesn't accept password, ruby script 'net/ssh'

I connect using ruby to the remote, pass the command, but channel.send_data ("passwd\n") dont work , I cant catch in than the reason. The password doesn't pass. require 'rubygems' require 'net/ssh' ... Net::SSH.start(@hostname, @username,…
0
votes
1 answer

Rails RSpec net-ssh mock return of second ssh request

I'm working on a web application that frequently access simulation data on a remote server. I want to create test for errors handling that might happen during these request. The problem I currently have is I cannot seems to mock a request with my…
Samuel
  • 513
  • 3
  • 17
0
votes
1 answer

How to proxy net-sftp?

I'm using net-sftp which relies on the net-ssh gem. I'm trying to connect to a remote log service via SFTP, and it requires IP whitelisting. All my current servers have dynamic IPs. I'm trying to set up a static, secure, proxy server in Google…
Tallboy
  • 12,847
  • 13
  • 82
  • 173
0
votes
1 answer

Running the workflows thru Ruby and Test gets passed but the workflows does not trigger

I am trying to run the informatica workflows thru ruby. Using the Net-ssh gem. When i run my test it gets passed but my jobs are not triggered when i check the logs they are not creating. Below is my code. Given(/^Run ESP jobs$/) do require…
Phantom
  • 31
  • 2
  • 7