Created
November 16, 2012 22:15
-
-
Save factormystic/4091377 to your computer and use it in GitHub Desktop.
Net::SSH agent forwarding test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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