Skip to content

Instantly share code, notes, and snippets.

/ruby.rb Secret

Created June 13, 2015 01:57
Show Gist options
  • Save anonymous/103040bdc7f74a69f75a to your computer and use it in GitHub Desktop.
Save anonymous/103040bdc7f74a69f75a to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'rubygems'
require 'net/ssh'
(File.open(ARGV[0])).each do |i|
print "#{i.chomp}: "
HOST = '#{i.chomp}'
USER = 'user'
PASS = 'password'
Net::SSH.start(HOST, USER, :password => PASS ) do|ssh|
result = ssh.exec!('uptime')
puts result
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment