Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'net/ssh'
- require 'logger'
- ssh_options = {}
- ssh_options[:auth_methods] = ["publickey"]
- ssh_options[:verbose] = :debug
- Net::SSH.start(
- 'login.example.com', 'rick', ssh_options
- ) do |session|
- output = ssh.exec!("hostname")
- puts output
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement