Skip to content

Instantly share code, notes, and snippets.

@jamesbcook
Created March 18, 2014 15:29
Show Gist options
  • Save jamesbcook/9622374 to your computer and use it in GitHub Desktop.
Save jamesbcook/9622374 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'net/scp'
Net::SSH.start('host','user',keys: ["~/.ssh.id_rsa.pub"]) do |ssh|
output = ssh.exec!("id;ifconfig;hostname")
puts output
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment