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

Capistrano fails without error message

I'm having problems deploying with Capistrano. The deploy works fine from my MacBook, but when I try to run it from a server (running Debian) it fails without any error message, or at least one that I can discern. With debug mode on: bundle exec cap…
Andrew Clark
  • 721
  • 7
  • 15
0
votes
1 answer

net-ssh not able to execute command

Why would net-ssh not be able to execute the useradd command? This is my net-ssh code: Net::SSH.start(host, user, forward_agent: true) do |ssh| ssh.open_channel do |ch| ch.request_pty ch.exec "mkdir /tmp/unicorn" ch.exec "sudo groupadd…
Eric Francis
  • 23,039
  • 31
  • 88
  • 122
0
votes
5 answers

Respond to a SSH prompt before first command with ruby and Net::SSH

I'm trying to connect, using Net::SSH, to a server that immediately after login executes a script that requires input from user. The user has to enter "1" or "2" and will receive some data via in the terminal afterwards. My problem is that, although…
Molotoff
  • 553
  • 5
  • 7
0
votes
1 answer

Net::SSH `wget` progress bar

I'm trying to relay the stdout of wget using net::ssh. Even though I have it setup like this: ssh.exec! cmd do |ch, stream, data| print data end I'm getting output like this: 0K .......... .......... .......... .......... .......... 1% 18.8M…
Dane O'Connor
  • 75,180
  • 37
  • 119
  • 173
0
votes
1 answer

NetSSh Gem , Start method producing Connection TimedOut Error

In my Project, I'm testing the connection with remote Windows 2008 server, through ssh. I'm always getting the following error: Errno::ETIMEDOUT: Connection timed out - connect(2) from…
Kamesh
  • 1,435
  • 1
  • 14
  • 27
0
votes
1 answer

How can use net/ssh gem to know if a package was installed?

I am trying to use the net/ssh gem to find an installed package into my Test-Kitchen instance. I do a simple recipe that reuse the build-essential cookbook. It is my recipe: node['my-cookbook']['packages'].each do |pkg| package pkg end And these…
Robert
  • 10,403
  • 14
  • 67
  • 117
0
votes
1 answer

Handling Errno::ETIMEDOUT exception in capistrano

I am using a block to dynamically generate a list of servers I want to push code to. Occasionally a few of the machines are unreachable, resulting in a "Errno::ETIMEDOUT". This stop the entire deployment process. How do I rescue this and run some…
Vinoth Gopi
  • 734
  • 4
  • 11
0
votes
1 answer

Unable to forward remote(ec2) port to the local port using ruby "net/ssh" gem in window environment

I am trying to forward the remote(ec2) port to local port to watch the jobtracker in my local browser which is running on amazon ec2 cluster. But unable to forward the remote port. Here is my…
Manohar
  • 1
  • 3
0
votes
1 answer

Rspec net-ssh session throws NoMethodError

I have a ruby script (scratch/ssh.rb) that runs an ssh session: require 'net/ssh' require 'net/ssh/shell' def try_process Net::SSH.start('host', 'username', {:password=>'pwd'}) do |ssh| end end I wrote a spec (spec/test_ssh.rb) as…
Tim
  • 2,008
  • 16
  • 22
0
votes
2 answers

get the information from the remote system using sudo command by using net::ssh in ruby

I have a situation as i have to login to remote system and get the their hardware information. I logged in to their system i have used ssh for this i am using net-ssh gem. here is my code where i logged into and get the…
r15
  • 486
  • 1
  • 8
  • 22
0
votes
0 answers

Could not retrieve local facts: closed stream

Has anyone every come across the following error when trying to use "puppet device" against cisco devices? Could not retrieve local facts: closed stream Its only happening on a few select devices but I cannot for the life of me figure out why I am…
user2864891
  • 11
  • 1
  • 3
0
votes
1 answer

Listing files of webdirectory with rails 4

Ruby 2.0, Rails 4. I made a site which serves static files. I used Dir.glob to list static files Now I have to save the files outside the app because the slugsize in Heroku will be too big otherwise For this reason, i would like a directory…
ksu
  • 608
  • 4
  • 11
0
votes
1 answer

How to pass ruby variable into sed command in Shell?

This is my code. I want to grab the p's value and insert it into the file changed.txt when matched 1. But it doesn't do what I want to, it seems it doesn't know what #{p} is Net::SSH.start( "192.168.2.1", "root", :password => "password") do |ssh| …
gugo
  • 237
  • 2
  • 7
  • 17
0
votes
3 answers

Net::SSH::Perl module: Executing multiple commands

I want to execute two commands in a single line using Net::SSH::Perl module.. Actually first command sets some env variable, second runs some command which needs the env variable to be set for that shell. How to make the below piece of code…
Thejas Thez
  • 1
  • 1
  • 1
0
votes
1 answer

AuthenticationFailed net-ssh ruby

When I'm trying to Net::SSH.start to my debian ssh server and transfer a files, every time I've a very strange error message - `start': Net::SSH::AuthenticationFailed, but all the authentication data are correct, I don't know what a problem is. Does…
Hu Man
  • 71
  • 1
  • 1
  • 7
1 2 3
13
14