Skip to content

Instantly share code, notes, and snippets.

@factormystic
Created November 16, 2012 22:15
Show Gist options
  • Save factormystic/4091377 to your computer and use it in GitHub Desktop.
Save factormystic/4091377 to your computer and use it in GitHub Desktop.
Net::SSH agent forwarding test
require 'net/ssh'
# Start Pageant and load your github & server identity keys
# :verbose => Logger::DEBUG
Net::SSH.start("your ssh server.com", "your username", { :forward_agent => true }) do |ssh|
result = ssh.exec!("ls -la ~")
puts result
# puts 'waiting on open channel...'
# ssh.open_channel do |ch|
# puts 'have open channel...'
result = ssh.exec!("ssh -T [email protected]")
puts result
# end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment