Skip to content

Instantly share code, notes, and snippets.

@jakerobinson
Created June 9, 2017 17:12
Show Gist options
  • Save jakerobinson/827e4fec5b9e5ff45b68997006f1aceb to your computer and use it in GitHub Desktop.
Save jakerobinson/827e4fec5b9e5ff45b68997006f1aceb to your computer and use it in GitHub Desktop.
# This fails when the remote machine's /etc/sshd_config contains the line MaxSessions 1
require 'net/ssh'
Net::SSH.start('1.2.3.4', 'root', :password => "foobar") do |ssh|
for i in 0..9
output = ssh.exec!("hostname")
puts output
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment